Fatima Shahid
Fatima Shahid

Reputation: 11

I'm facing these errors when I run command (npx react-native init AwesomeProject)

Downloading template error Error: Command failed: npm install --save --save-exact react-native@latest npm ERR! Windows_NT 10.0.18363 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\lenovo\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "--save" "--save-exact" "react-native@latest" npm ERR! node v14.15.1 npm ERR! npm v4.0.0

npm ERR! cb.apply is not a function npm ERR! npm ERR! If you need help, you may report this error at: npm ERR! https://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request: npm ERR! C:\Users\lenovo\AppData\Local\Temp\rncli-init-template-O81d4q\npm-debug.log

Upvotes: 0

Views: 1010

Answers (1)

Sebastian Richner
Sebastian Richner

Reputation: 760

It looks like you are using npm 4, updating npm to a version >= 6 should fix your issue (which should come by default with Node 12 and 14) according to this issue here.

You might also try this solution:

  1. C:\Users(your username)\AppData\Roaming
  2. Delete the npm folder and if there is one npm cache folder.
  3. Run npm cache clean —force ( — force is now required to clean cache)

Upvotes: 0

Related Questions