berry: [Bug] Dependencies with noisy prepare scripts fail to install

  • I’d be willing to implement a fix

Describe the bug

Git dependencies with prepare scripts that output warnings/errors to stdout fail to install

To Reproduce

Reproduction

Playground

const installPromise = packageJsonAndInstall({
dependencies: {
[`redux-thunk`]: `https://github.com/reduxjs/redux-thunk.git#v2.3.0`,
},
});

await expect(installPromise)
.resolves.toBeTruthy();

Output:

Error: expect(received).resolves.toBeTruthy()

Received promise rejected instead of resolved
Rejected to value: [Error: Command failed: /usr/local/bin/node /sandbox/berry/scripts/actions/../run-yarn.js install·
➤ YN0000: ┌ Resolution step
➤ YN0013: │ redux-thunk@https://github.com/reduxjs/redux-thunk.git#commit=4ea70e9196b0388c8527e26bde4e4d2659252bae can't be found in the cache and will be fetched from GitHub
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT Installing the project using npm
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
➤ YN0000: │ /tmp/xfs-b0145206 STDERR npm WARN lifecycle The node binary used for scripts is /tmp/xfs-9b3f3d5c/node but npm is using /usr/local/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT > redux-thunk@2.3.0 prepare /tmp/xfs-b0145206
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT > npm run clean && npm run lint && npm run test && npm run build
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
➤ YN0000: │ /tmp/xfs-b0145206 STDERR npm WARN lifecycle The node binary used for scripts is /tmp/xfs-9b3f3d5c/node but npm is using /usr/local/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT > redux-thunk@2.3.0 clean /tmp/xfs-b0145206
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT > rimraf lib dist es
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
➤ YN0000: │ /tmp/xfs-b0145206 STDERR npm WARN lifecycle The node binary used for scripts is /tmp/xfs-9b3f3d5c/node but npm is using /usr/local/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT > redux-thunk@2.3.0 lint /tmp/xfs-b0145206
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT > eslint src test
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
➤ YN0000: │ /tmp/xfs-b0145206 STDERR npm WARN lifecycle The node binary used for scripts is /tmp/xfs-9b3f3d5c/node but npm is using /usr/local/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT > redux-thunk@2.3.0 test /tmp/xfs-b0145206
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT > cross-env BABEL_ENV=commonjs mocha --compilers js:babel-core/register --reporter spec test/*.js
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT   thunk middleware
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
  ✓ must return a function to handle next
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT     handle next
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
    ✓ must return a function to handle action
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT       handle action
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
      ✓ must run the given action function with dispatch and getState
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
      ✓ must pass action to next if not a function
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
      ✓ must return the return value of next if not a function
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
      ✓ must return value as expected if a function
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
      ✓ must be invoked synchronously if a function
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT     handle errors
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
    ✓ must throw if argument is non-object
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT     withExtraArgument
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
    ✓ must pass the third argument
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT     TypeScript definitions
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
    ✓ should compile against index.d.ts (2091ms)
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT   10 passing (2s)
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
➤ YN0000: │ /tmp/xfs-b0145206 STDERR npm WARN lifecycle The node binary used for scripts is /tmp/xfs-9b3f3d5c/node but npm is using /usr/local/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT > redux-thunk@2.3.0 build /tmp/xfs-b0145206
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT > npm run build:commonjs && npm run build:umd && npm run build:umd:min && npm run build:es
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
➤ YN0000: │ /tmp/xfs-b0145206 STDERR npm WARN lifecycle The node binary used for scripts is /tmp/xfs-9b3f3d5c/node but npm is using /usr/local/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT > redux-thunk@2.3.0 build:commonjs /tmp/xfs-b0145206
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT > cross-env BABEL_ENV=commonjs babel src --out-dir lib
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT src/index.js -> lib/index.js
➤ YN0000: │ /tmp/xfs-b0145206 STDERR npm WARN lifecycle The node binary used for scripts is /tmp/xfs-9b3f3d5c/node but npm is using /usr/local/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT > redux-thunk@2.3.0 build:umd /tmp/xfs-b0145206
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT > cross-env BABEL_ENV=commonjs NODE_ENV=development webpack
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT Hash: aa84e48162d2a5fe0af1
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT Version: webpack 1.15.0
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT Time: 288ms
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT          Asset     Size  Chunks             Chunk Names
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT redux-thunk.js  2.43 kB       0  [emitted]  main
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT    [0] multi main 28 bytes {0} [built]
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT     + 1 hidden modules
➤ YN0000: │ /tmp/xfs-b0145206 STDERR npm WARN lifecycle The node binary used for scripts is /tmp/xfs-9b3f3d5c/node but npm is using /usr/local/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT > redux-thunk@2.3.0 build:umd:min /tmp/xfs-b0145206
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT > cross-env BABEL_ENV=commonjs NODE_ENV=production webpack
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT Hash: c9933422eb1206ce9978
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT Version: webpack 1.15.0
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT Time: 330ms
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT              Asset       Size  Chunks             Chunk Names
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT redux-thunk.min.js  692 bytes       0  [emitted]  main
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT    [0] multi main 28 bytes {0} [built]
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT     + 1 hidden modules
➤ YN0000: │ /tmp/xfs-b0145206 STDERR npm WARN lifecycle The node binary used for scripts is /tmp/xfs-9b3f3d5c/node but npm is using /usr/local/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT > redux-thunk@2.3.0 build:es /tmp/xfs-b0145206
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT > cross-env BABEL_ENV=es babel src --out-dir es
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT src/index.js -> es/index.js
➤ YN0000: │ /tmp/xfs-b0145206 STDERR npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
➤ YN0000: │ /tmp/xfs-b0145206 STDERR npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
➤ YN0000: │ /tmp/xfs-b0145206 STDERR·
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT added 386 packages from 557 contributors and audited 456 packages in 14.465s
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT found 449 vulnerabilities (161 low, 2 moderate, 284 high, 2 critical)
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT   run `npm audit fix` to fix them, or `npm audit` for details
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT   thunk middleware
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
  ✓ must return a function to handle next
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT     handle next
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
    ✓ must return a function to handle action
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT       handle action
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
      ✓ must run the given action function with dispatch and getState
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
      ✓ must pass action to next if not a function
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
      ✓ must return the return value of next if not a function
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
      ✓ must return value as expected if a function
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
      ✓ must be invoked synchronously if a function
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT     handle errors
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
    ✓ must throw if argument is non-object
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT     withExtraArgument
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
    ✓ must pass the third argument
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT     TypeScript definitions
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
    ✓ should compile against index.d.ts (1738ms)
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT   10 passing (2s)
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT·
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT src/index.js -> lib/index.js
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT Hash: aa84e48162d2a5fe0af1
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT Version: webpack 1.15.0
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT Time: 293ms
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT          Asset     Size  Chunks             Chunk Names
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT redux-thunk.js  2.43 kB       0  [emitted]  main
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT    [0] multi main 28 bytes {0} [built]
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT     + 1 hidden modules
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT Hash: c9933422eb1206ce9978
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT Version: webpack 1.15.0
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT Time: 343ms
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT              Asset       Size  Chunks             Chunk Names
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT redux-thunk.min.js  692 bytes       0  [emitted]  main
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT    [0] multi main 28 bytes {0} [built]
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT     + 1 hidden modules
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT src/index.js -> es/index.js
➤ YN0000: │ /tmp/xfs-b0145206 STDOUT redux-thunk-2.3.0.tgz
➤ YN0013: │ redux-thunk@https://github.com/reduxjs/redux-thunk.git#commit=4ea70e9196b0388c8527e26bde4e4d2659252bae can't be found in the cache and will be fetched from the remote repository
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT Installing the project using npm
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
➤ YN0000: │ /tmp/xfs-47400c86 STDERR npm WARN lifecycle The node binary used for scripts is /tmp/xfs-d4bdf31a/node but npm is using /usr/local/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT > redux-thunk@2.3.0 prepare /tmp/xfs-47400c86
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT > npm run clean && npm run lint && npm run test && npm run build
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
➤ YN0000: │ /tmp/xfs-47400c86 STDERR npm WARN lifecycle The node binary used for scripts is /tmp/xfs-d4bdf31a/node but npm is using /usr/local/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT > redux-thunk@2.3.0 clean /tmp/xfs-47400c86
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT > rimraf lib dist es
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
➤ YN0000: │ /tmp/xfs-47400c86 STDERR npm WARN lifecycle The node binary used for scripts is /tmp/xfs-d4bdf31a/node but npm is using /usr/local/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT > redux-thunk@2.3.0 lint /tmp/xfs-47400c86
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT > eslint src test
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
➤ YN0000: │ /tmp/xfs-47400c86 STDERR npm WARN lifecycle The node binary used for scripts is /tmp/xfs-d4bdf31a/node but npm is using /usr/local/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT > redux-thunk@2.3.0 test /tmp/xfs-47400c86
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT > cross-env BABEL_ENV=commonjs mocha --compilers js:babel-core/register --reporter spec test/*.js
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT   thunk middleware
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
  ✓ must return a function to handle next
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT     handle next
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
    ✓ must return a function to handle action
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT       handle action
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
      ✓ must run the given action function with dispatch and getState
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
      ✓ must pass action to next if not a function
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
      ✓ must return the return value of next if not a function
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
      ✓ must return value as expected if a function
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
      ✓ must be invoked synchronously if a function
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT     handle errors
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
    ✓ must throw if argument is non-object
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT     withExtraArgument
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
    ✓ must pass the third argument
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT     TypeScript definitions
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
    ✓ should compile against index.d.ts (2351ms)
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT   10 passing (3s)
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
➤ YN0000: │ /tmp/xfs-47400c86 STDERR npm WARN lifecycle The node binary used for scripts is /tmp/xfs-d4bdf31a/node but npm is using /usr/local/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT > redux-thunk@2.3.0 build /tmp/xfs-47400c86
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT > npm run build:commonjs && npm run build:umd && npm run build:umd:min && npm run build:es
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
➤ YN0000: │ /tmp/xfs-47400c86 STDERR npm WARN lifecycle The node binary used for scripts is /tmp/xfs-d4bdf31a/node but npm is using /usr/local/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT > redux-thunk@2.3.0 build:commonjs /tmp/xfs-47400c86
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT > cross-env BABEL_ENV=commonjs babel src --out-dir lib
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT src/index.js -> lib/index.js
➤ YN0000: │ /tmp/xfs-47400c86 STDERR npm WARN lifecycle The node binary used for scripts is /tmp/xfs-d4bdf31a/node but npm is using /usr/local/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT > redux-thunk@2.3.0 build:umd /tmp/xfs-47400c86
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT > cross-env BABEL_ENV=commonjs NODE_ENV=development webpack
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT Hash: aa84e48162d2a5fe0af1
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT Version: webpack 1.15.0
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT Time: 315ms
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT          Asset     Size  Chunks             Chunk Names
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT redux-thunk.js  2.43 kB       0  [emitted]  main
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT    [0] multi main 28 bytes {0} [built]
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT     + 1 hidden modules
➤ YN0000: │ /tmp/xfs-47400c86 STDERR npm WARN lifecycle The node binary used for scripts is /tmp/xfs-d4bdf31a/node but npm is using /usr/local/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT > redux-thunk@2.3.0 build:umd:min /tmp/xfs-47400c86
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT > cross-env BABEL_ENV=commonjs NODE_ENV=production webpack
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT Hash: c9933422eb1206ce9978
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT Version: webpack 1.15.0
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT Time: 377ms
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT              Asset       Size  Chunks             Chunk Names
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT redux-thunk.min.js  692 bytes       0  [emitted]  main
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT    [0] multi main 28 bytes {0} [built]
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT     + 1 hidden modules
➤ YN0000: │ /tmp/xfs-47400c86 STDERR npm WARN lifecycle The node binary used for scripts is /tmp/xfs-d4bdf31a/node but npm is using /usr/local/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT > redux-thunk@2.3.0 build:es /tmp/xfs-47400c86
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT > cross-env BABEL_ENV=es babel src --out-dir es
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT src/index.js -> es/index.js
➤ YN0000: │ /tmp/xfs-47400c86 STDERR npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
➤ YN0000: │ /tmp/xfs-47400c86 STDERR npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
➤ YN0000: │ /tmp/xfs-47400c86 STDERR·
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT added 386 packages from 557 contributors and audited 456 packages in 16.139s
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT found 449 vulnerabilities (161 low, 2 moderate, 284 high, 2 critical)
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT   run `npm audit fix` to fix them, or `npm audit` for details
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT   thunk middleware
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
  ✓ must return a function to handle next
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT     handle next
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
    ✓ must return a function to handle action
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT       handle action
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
      ✓ must run the given action function with dispatch and getState
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
      ✓ must pass action to next if not a function
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
      ✓ must return the return value of next if not a function
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
      ✓ must return value as expected if a function
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
      ✓ must be invoked synchronously if a function
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT     handle errors
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
    ✓ must throw if argument is non-object
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT     withExtraArgument
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
    ✓ must pass the third argument
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT     TypeScript definitions
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
    ✓ should compile against index.d.ts (2891ms)
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT   10 passing (3s)
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT·
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT src/index.js -> lib/index.js
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT Hash: aa84e48162d2a5fe0af1
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT Version: webpack 1.15.0
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT Time: 309ms
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT          Asset     Size  Chunks             Chunk Names
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT redux-thunk.js  2.43 kB       0  [emitted]  main
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT    [0] multi main 28 bytes {0} [built]
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT     + 1 hidden modules
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT Hash: c9933422eb1206ce9978
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT Version: webpack 1.15.0
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT Time: 453ms
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT              Asset       Size  Chunks             Chunk Names
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT redux-thunk.min.js  692 bytes       0  [emitted]  main
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT    [0] multi main 28 bytes {0} [built]
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT     + 1 hidden modules
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT src/index.js -> es/index.js
➤ YN0000: │ /tmp/xfs-47400c86 STDOUT redux-thunk-2.3.0.tgz
➤ YN0001: │ Error: redux-thunk@https://github.com/reduxjs/redux-thunk.git#commit=4ea70e9196b0388c8527e26bde4e4d2659252bae: ENAMETOOLONG: name too long, rename '/tmp/xfs-47400c86/thunk middleware·
  ✓ must return a function to handle next
  handle next·
    ✓ must return a function to handle action
    handle action·
      ✓ must run the given action function with dispatch and getState·
      ✓ must pass action to next if not a function·
      ✓ must return the return value of next if not a function·
      ✓ must return value as expected if a function·
      ✓ must be invoked synchronously if a function
  handle errors·
    ✓ must throw if argument is non-object
  withExtraArgument·
    ✓ must pass the third argument
  TypeScript definitions·
    ✓ should compile against index.d.ts (2891ms)··
10 passing (3s)·
src/index.js -> lib/index.js
Hash: aa84e48162d2a5fe0af1
Version: webpack 1.15.0
Time: 309ms
       Asset     Size  Chunks             Chunk Names
redux-thunk.js  2.43 kB       0  [emitted]  main
 [0] multi main 28 bytes {0} [built]
  + 1 hidden modules
Hash: c9933422eb1206ce9978
Version: webpack 1.15.0
Time: 453ms
           Asset       Size  Chunks             Chunk Names
redux-thunk.min.js  692 bytes       0  [emitted]  main
 [0] multi main 28 bytes {0} [built]
  + 1 hidden modules
src/index.js -> es/index.js
redux-thunk-2.3.0.tgz' -> '/tmp/xfs-47400c86/package.tgz'
➤ YN0000: └ Completed in 53s 937ms
➤ YN0000: Failed with errors in 53s 938ms
]
  at expect (/sandbox/node_modules/expect/build/index.js:138:15)
  at module.exports (evalmachine.:8:7)
  at executeInTempDirectory (/sandbox/node_modules/@arcanis/sherlock/lib/executeRepro.js:56:19)
  at executeInTempDirectory (/sandbox/node_modules/@arcanis/sherlock/lib/executeRepro.js:17:22)
  at executeRepro (/sandbox/node_modules/@arcanis/sherlock/lib/executeRepro.js:24:18)
  at module.exports../pages/api/sherlock.js.__webpack_exports__.default (/sandbox/.next/server/static/development/pages/api/sherlock.js:140:122)
  at Object.apiResolver (/sandbox/node_modules/next/dist/next-server/server/api-utils.js:46:15)
  at process._tickCallback (internal/process/next_tick.js:68:7)

Environment if relevant (please complete the following information):

  • OS: [e.g. OSX, Linux, Windows, …] Windows + Sherlock sandbox
  • Node version [e.g. 8.15.0, 10.15.1, …] 12.18.3
  • Yarn version [e.g. 2.0.0-rc1, …] 2.3.3-git.20201014.b2742f6e

Additional context This is a result of using the output of npm pack --silent as the pack name: https://github.com/yarnpkg/berry/blob/97a66ff6b3ef0bc5a2ee6d0b502b6efc59a31298/packages/yarnpkg-core/sources/scriptUtils.ts#L227-L235

I’m confused as to why yarn tries to fetch the package twice, once with:

YN0013: │ redux-thunk@https://github.com/reduxjs/redux-thunk.git#commit=4ea70e9196b0388c8527e26bde4e4d2659252bae can't be found in the cache and will be fetched from GitHub

and the second time with

YN0013: │ redux-thunk@https://github.com/reduxjs/redux-thunk.git#commit=4ea70e9196b0388c8527e26bde4e4d2659252bae can't be found in the cache and will be fetched from the remote repository

Looks like the first npm pack even succeeded.

I’m not too familiar with the specifics of npm usage, but wouldn’t just using <name>-<version>.tgz as the pack name suffice instead of parsing npm pack output? Or is there no easy way of getting that info? It seems risky to rely on dependencies to not have output in their prepare/prepack scripts.

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 3
  • Comments: 15 (3 by maintainers)

Commits related to this issue

Most upvoted comments

Confirmed that surrounding the glob with single quotes solves this problem on v4.1.0.

-"lint": "eslint --ignore-path .gitignore --ignore-pattern **/*.d.ts ."
+"lint": "eslint --ignore-path .gitignore --ignore-pattern '**/*.d.ts' ."

@XDoubleU I ran into this same issue when migrating a project from yarn classic to yarn 3.5 with our package.json lint command using eslint. Try adding single quotes around the file glob pattern. I am not sure why it is causing issues but this fixed the problem we were having. Ex: prettier --write './**/*.{ts,tsx}'

I’ve hit a familiar bug with it too.

PS D:\dev\2022-HP> yarn lint
Internal Error: spawn ENAMETOOLONG
    at ChildProcess.spawn (node:internal/child_process:413:11)
    at Object.spawn (node:child_process:713:9)
    at VM (D:\dev\2022-HP\.yarn\releases\yarn-3.2.3.cjs:4:7429)
    at Kd.implementation (D:\dev\2022-HP\.yarn\releases\yarn-3.2.3.cjs:392:18472)
    at Kd.exec (D:\dev\2022-HP\.yarn\releases\yarn-3.2.3.cjs:395:1583)
    at Kd.run (D:\dev\2022-HP\.yarn\releases\yarn-3.2.3.cjs:395:1754)
    at e9 (D:\dev\2022-HP\.yarn\releases\yarn-3.2.3.cjs:401:6555)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async KPe (D:\dev\2022-HP\.yarn\releases\yarn-3.2.3.cjs:403:16)