facebook / create-react-app

Set up a modern web app by running one command.
https://create-react-app.dev
MIT License
102.65k stars 26.81k forks source link

Error on creating a react app #12423

Open JRoman2018 opened 2 years ago

JRoman2018 commented 2 years ago

image

ShatterPlayer commented 2 years ago

It looks like a problem with npm itself. Try following instructions from this comment.

JRoman2018 commented 2 years ago

It looks like a problem with npm itself. Try following instructions from this comment.

I tried this, but didn't work for me.

ShatterPlayer commented 2 years ago

Have you tried changing NodeJS version?

krreet commented 2 years ago

Hi JRoman2018 , Looks like this issue is with your local system . Try to clean you node/npm cache , directories. If not sure try it with another machine. if the issue doesn't persist then the issue is most likely in your local system . something which is not CRA issue.

JRoman2018 commented 1 year ago

Hi JRoman2018 , Looks like this issue is with your local system . Try to clean you node/npm cache , directories. If not sure try it with another machine. if the issue doesn't persist then the issue is most likely in your local system . something which is not CRA issue.

I tried cleaning the node/npm cache. But still didn't work.

SamuelBanya commented 1 year ago

I did the same action and have received the same issue as mentioned before, do not close this issue as this is clearly related to 'facebook/create-react-app' side of the issue.

Version of 'node' via 'NVM' being used:

samuelbanya@Samuels-MBP ~/hub/Development/code/phase-4/phase-4-lecture-videos-client-configuration/flatiron-theater $ nvm list
->     v16.14.2
         system
default -> lts/* (-> v16.14.2)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v16.14.2) (default)
stable -> 16.14 (-> v16.14.2) (default)
lts/* -> lts/gallium (-> v16.14.2)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.17.0 (-> N/A)
lts/dubnium -> v10.24.1 (-> N/A)
lts/erbium -> v12.22.11 (-> N/A)
lts/fermium -> v14.19.1 (-> N/A)
lts/gallium -> v16.14.2

Related output that matches @JRoman2018 's output:

samuelbanya@Samuels-MBP ~/hub/Development/code/phase-4/phase-4-lecture-videos-client-configuration/flatiron-theater $ npx create create-react-app client --use-npm
npm ERR! cb.apply is not a function

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/samuelbanya/.npm/_logs/2022-10-25T23_50_46_959Z-debug.log
Install for [ 'create@latest' ] failed with code 1

Related output in '/Users/samuelbanya/.npm/_logs/2022-10-25T23_50_46_959Z-debug.log':

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   '/Users/samuelbanya/.nvm/versions/node/v16.14.2/bin/node',
1 verbose cli   '/Users/samuelbanya/.nvm/versions/node/v16.14.2/lib/node_modules/npx/node_modules/npm/bin/npm-cli.js',
1 verbose cli   'install',
1 verbose cli   'create@latest',
1 verbose cli   '--global',
1 verbose cli   '--prefix',
1 verbose cli   '/Users/samuelbanya/.npm/_npx/15628',
1 verbose cli   '--loglevel',
1 verbose cli   'error',
1 verbose cli   '--json'
1 verbose cli ]
2 info using npm@5.1.0
3 info using node@v16.14.2
4 verbose npm-session 4d13296a1532d757
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 200 https://registry.npmjs.org/create 23ms (from cache)
8 silly pacote tag manifest for create@latest fetched in 39ms
9 verbose stack TypeError: cb.apply is not a function
9 verbose stack     at /Users/samuelbanya/.nvm/versions/node/v16.14.2/lib/node_modules/npx/node_modules/npm/node_modules/graceful-fs/polyfills.js:287:18
9 verbose stack     at FSReqCallback.oncomplete (node:fs:199:5)
10 verbose cwd /Users/samuelbanya/hub/Development/code/phase-4/phase-4-lecture-videos-client-configuration/flatiron-theater
11 verbose Darwin 21.6.0
12 verbose argv "/Users/samuelbanya/.nvm/versions/node/v16.14.2/bin/node" "/Users/samuelbanya/.nvm/versions/node/v16.14.2/lib/node_modules/npx/node_modules/npm/bin/npm-cli.js" "install" "create@latest" "--global" "--prefix" "/Users/samuelbanya/.npm/_npx/15628" "--loglevel" "error" "--json"
13 verbose node v16.14.2
14 verbose npm  v5.1.0
15 error cb.apply is not a function
16 verbose exit [ 1, true ]
SamuelBanya commented 1 year ago

Update on this one, this command fixed my issue, aka I upgraded my 'nvm' to use the latest 'lts' release via the following command:

nvm install --lts

Now I am able to use the 'npx create-react-app client --use-npm' command without an issue.

With this in mind, this issue is isolated to 'node' version 16.14.2 on MacOS.