Describe the bug
I tried to run npx sb@latest info and it printed out error.
npx sb@latest info
Environment Info:
(node:81872) UnhandledPromiseRejectionWarning: TypeError: (e || []).filter is not a function
at /Users/henrycity/.npm/_npx/81872/lib/node_modules/sb/node_modules/envinfo/dist/envinfo.js:1:73314
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async Promise.all (index 6)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:81872) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:81872) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Other seems to have the same issue: https://github.com/storybookjs/storybook/issues/11639
what version of npx are you using? what version of node?
My node version is 14.8.0
My npx version is 6.14.7.
If I try to upgrade npx by npm i -g --force npx to 10.2.2 then I am getting this error when running npx sb@latest info
npx sb@latest info
npm ERR! cb.apply is not a function
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/henrycity/.npm/_logs/2020-08-14T20_54_42_941Z-debug.log
Install for [ 'sb@latest' ] failed with code 1
Debug log file
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli '/Users/henrycity/.nvm/versions/node/v14.8.0/bin/node',
1 verbose cli '/Users/henrycity/.nvm/versions/node/v14.8.0/lib/node_modules/npx/node_modules/npm/bin/npm-cli.js',
1 verbose cli 'install',
1 verbose cli 'sb@latest',
1 verbose cli '--global',
1 verbose cli '--prefix',
1 verbose cli '/Users/henrycity/.npm/_npx/99718',
1 verbose cli '--loglevel',
1 verbose cli 'error',
1 verbose cli '--json'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session cfdd38d7162bf15b
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 304 https://registry.npmjs.org/sb 107ms (from cache)
8 silly pacote tag manifest for sb@latest fetched in 133ms
9 verbose stack TypeError: cb.apply is not a function
9 verbose stack at /Users/henrycity/.nvm/versions/node/v14.8.0/lib/node_modules/npx/node_modules/npm/node_modules/graceful-fs/polyfills.js:287:18
9 verbose stack at FSReqCallback.oncomplete (fs.js:177:5)
10 verbose cwd /Users/henrycity/Projects/posti-web-components
11 verbose Darwin 19.6.0
12 verbose argv "/Users/henrycity/.nvm/versions/node/v14.8.0/bin/node" "/Users/henrycity/.nvm/versions/node/v14.8.0/lib/node_modules/npx/node_modules/npm/bin/npm-cli.js" "install" "sb@latest" "--global" "--prefix" "/Users/henrycity/.npm/_npx/99718" "--loglevel" "error" "--json"
13 verbose node v14.8.0
14 verbose npm v5.1.0
15 error cb.apply is not a function
16 verbose exit [ 1, true ]
Hmm any chance you can try an older version? Perhaps we're not node@14 compatible yet? We'll def fix, but first I'd like to verify that's the problem.
$ npx --version
6.14.4
$ node -v
v12.16.2
I still have the same problem if I use ([email protected] , [email protected]) or ([email protected] , [email protected])
Environment Info:
(node:5859) UnhandledPromiseRejectionWarning: TypeError: (e || []).filter is not a function
at /Users/henrycity/.npm/_npx/5859/lib/node_modules/sb/node_modules/envinfo/dist/envinfo.js:1:73314
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async Promise.all (index 6)
(node:5859) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:5859) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
So uninstalling Edge fixes the issue. This is an issue related to envinfo package: https://github.com/tabrindle/envinfo/issues/184
Thanks so much for tracking it down! 馃檹
What do you think we should do about it, if anything?
The only thing we could do on is adding a note somewhere about this issue.
Otherwise, we need to wait for the author of envinfo to merge the PR (https://github.com/tabrindle/envinfo/pull/185) that fixes the issue.