Getting Error 404 while running npm install create-react-app - node.js

Getting error 404 while running npm install create-react-app or npm install -g npm#latest.
Log:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli 'create-react-app' ]
2 info using npm#5.6.0
3 info using node#v8.11.3
4 verbose npm-session 1f3eafc1b2f09e93
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 404 http://registry.npmjs.org/create-react-app 66ms
8 silly fetchPackageMetaData error for create-react-app#latest 404 Not Found: create-react-app#latest
9 verbose stack Error: 404 Not Found: create-react-app#latest
9 verbose stack at fetch.then.res (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\lib\fetchers\registry\fetch.js:42:19)
9 verbose stack at tryCatcher (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
9 verbose stack at Promise._settlePromiseFromHandler (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:512:31)
9 verbose stack at Promise._settlePromise (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:569:18)
9 verbose stack at Promise._settlePromise0 (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:614:10)
9 verbose stack at Promise._settlePromises (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:693:18)
9 verbose stack at Async._drainQueue (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:133:16)
9 verbose stack at Async._drainQueues (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:143:10)
9 verbose stack at Immediate.Async.drainQueues (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:17:14)
9 verbose stack at runCallback (timers.js:810:20)
9 verbose stack at tryOnImmediate (timers.js:768:5)
9 verbose stack at processImmediate [as _immediateCallback] (timers.js:745:5)
10 verbose cwd M:\Projects\TestApps\ReactApp
11 verbose Windows_NT 6.1.7601
12 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "create-react-app"
13 verbose node v8.11.3
14 verbose npm v5.6.0
15 error code E404
16 error 404 Not Found: create-react-app#latest
17 verbose exit [ 1, true ]

First check if is a Proxy Issue.
Try to install the package with another internet connection!
Another causes
Missing repository registry
$ npm set registry https://registry.npmjs.org/
Clean cache
$ npm cache clean
$ npm rebuild

My problem also same but when I try following commands then works fine
If you've previously installed create-react-app globally via npm install -g create-react-app, I recommend you uninstall the package using npm uninstall -g create-react-app to ensure that npx always uses the latest version.
Then reinstall using
npm install -g create-react-app

You have already installed the npm create-react-app globally. You can just write
npm init react-app *projectFolderName*
and it will work just fine.

I was having the same problem for almost a week here is my simple solution if you are using windows 1 run cmd as admin, 2 put this url 'npm config set registry https://skimdb.npmjs.com/registry' on cmd,3 then type 'npx create-react-app#latest YourProjectName'

The newest way to do this would be to use npx.
npx create-react-app my-app [...options]
I use this method because I also use nvm to manage node installs. Everything just plays nice with this method.

Try uninstalling the current version of npm and install the latest version using
npm install -g create-react-app

For me restarting my code editor did the job

You can try this command, which has worked for me:
npm config set strict-ssl false

Related

I can't install react using npx create-react-app is this aNodist the issue?

I've received the following in the debug log. I'm looking to npx create-react-app. The terminal is returning
npm ERR! cb.apply is not a function
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\User\AppData\Roaming\npm-cache_logs\2022-06-07T14_57_21_064Z-debug.log
Install for [ 'create-react-app#latest' ] failed with code 1
This is the debug file...
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files (x86)\\Nodist\\v-x64\\18.1.0\\node.exe',
1 verbose cli 'C:\\Program Files (x86)\\Nodist\\bin\\node_modules\\npx\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli 'create-react-app#latest',
1 verbose cli '--global',
1 verbose cli '--prefix',
1 verbose cli 'C:\\Users\\User\\AppData\\Roaming\\npm-cache\\_npx\\50292',
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#v18.1.0
4 verbose npm-session 56a59e1a77678c6d
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 200 https://registry.npmjs.org/create-react-app 102ms (from cache)
8 silly pacote tag manifest for create-react-app#latest fetched in 165ms
9 verbose stack TypeError: cb.apply is not a function
9 verbose stack at C:\Program Files (x86)\Nodist\bin\node_modules\npx\node_modules\npm\node_modules\graceful-fs\polyfills.js:287:18
9 verbose stack at FSReqCallback.oncomplete (node:fs:204:5)
10 verbose cwd C:\Users\User\Websites\react
11 verbose Windows_NT 10.0.19044
12 verbose argv "C:\\Program Files (x86)\\Nodist\\v-x64\\18.1.0\\node.exe" "C:\\Program Files (x86)\\Nodist\\bin\\node_modules\\npx\\node_modules\\npm\\bin\\npm-cli.js" "install" "create-react-app#latest" "--global" "--prefix" "C:\\Users\\User\\AppData\\Roaming\\npm-cache\\_npx\\50292" "--loglevel" "error" "--json"
13 verbose node v18.1.0
14 verbose npm v5.1.0
15 error cb.apply is not a function
16 verbose exit [ 1, true ]
I'm using the latest beta version of Node, so I'll try to go back to the latest stable version. If that doesn't work, I'll try to re-download node away from nodist..
If you have any other thoughts or suggestions Perhaps there is a hint in the debug log, then I'd be glad to hear them.
According to the discussion under github https://github.com/facebook/create-react-app/discussions/10173#discussioncomment-142156
you need to
npm rm -g create-react-app
npm install create-react-app
npx create-react-app my-app
After deleting the Nodist version manager. I installed nvm and I'm now able to get npx to work without a problem. I think the issue for me was that I was using the nodist version manager.
Highly recommend checking out nvm here if you get similar issues.
https://github.com/coreybutler/nvm-windows/wiki

npm install reactjs app npm ERR! code E404

I am new to reactjs, and I am trying to create a reactjs app, and I follow the steps on react web, and it shows error. My node version is v8.11.1.npx version is 9.7.1.
btw I can create the app with npx create-react-app, but when fail with npm.
MacBook-teddy$ npm install -g create-react-app
create-react-app amber_Web
npm ERR! code E404
npm ERR! 404 Not Found: amber_Web#latest
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/teddy/.npm/_logs/2018-06-07T02_08_37_384Z-debug.log
And this is the log file:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli 'create-react-app',
1 verbose cli 'create-react-app',
1 verbose cli 'amber_Web' ]
2 info using npm#5.6.0
3 info using node#v8.11.1
4 verbose npm-session 452b1b32f613b960
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 200 https://registry.npmjs.org/create-react-app 32ms (from cache)
8 silly pacote tag manifest for create-react-app#latest fetched in 52ms
9 http fetch GET 404 https://registry.npmjs.org/amber_Web 1545ms
10 silly fetchPackageMetaData error for amber_Web#latest 404 Not Found: amber_Web#latest
11 verbose stack Error: 404 Not Found: amber_Web#latest
11 verbose stack at fetch.then.res (/usr/local/lib/node_modules/npm/node_modules/pacote/lib/fetchers/registry/fetch.js:42:19)
11 verbose stack at tryCatcher (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
11 verbose stack at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:512:31)
11 verbose stack at Promise._settlePromise (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
11 verbose stack at Promise._settlePromise0 (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
11 verbose stack at Promise._settlePromises (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
11 verbose stack at Async._drainQueue (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:133:16)
11 verbose stack at Async._drainQueues (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:143:10)
11 verbose stack at Immediate.Async.drainQueues (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:17:14)
11 verbose stack at runCallback (timers.js:794:20)
11 verbose stack at tryOnImmediate (timers.js:752:5)
11 verbose stack at processImmediate [as _immediateCallback] (timers.js:729:5)
12 verbose cwd /Users/teddy/Desktop
13 verbose Darwin 17.5.0
14 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "create-react-app" "create-react-app" "amber_Web"
15 verbose node v8.11.1
16 verbose npm v5.6.0
17 error code E404
18 error 404 Not Found: amber_Web#latest
19 verbose exit [ 1, true ]
Thanks.
Looks like you tried to run create-react-app while installing it.
Run npm install -g create-react-app although this should already be installed.
Then run create-react-app amber-web
EDIT:
The reason this error out was because you put npm install -g create-react-app
create-react-app amber_Web all in one command telling npm to install the create-react-app package twice and the amber_Web package but that package doesn't exist hence the 404 error.
* name can no longer contain capital letters
The error is because npm follows the application naming conventions, according to which it is not allowed to use upper case letters in the application names also.
Kindly try using create-react-app amber_web
To learn more kindly visit : npmjs docs
try:
npm doctor
npm ping
"npm doctor runs a set of checks to ensure that your npm installation has what it needs to manage your JavaScript packages."
I think there could be problem in both cash and aslo react installation, so you should try:
npm cache clean --force
Then
npm install -g create-react-app
After that see your installation right or not by this
create-react-app --version
If it works then everything is ok now, but if not then you should try to uninstall node.js and try to search all it's caching folder delete them and install as frash node.js then insall react js.
try this
npm cache clean --force
and then
create-react-app your_app_name
Nothing helped me except
npm install -g webpack
npm -g list
├── create-react-app#5.0.1
└── webpack#5.73.0
Just set the registry as-
npm config set registry http://registry.npmjs.org
And then run
npm install -g create-react-app
create the project
npx create-react-app your_app_name

nodemon install error "No valid versions available for timed-out"

I am getting this error when trying to install nodemon in a brand new node project.
I've created a blank folder named my-project
then, inside it, I've executed to creeate a package.json file:
npm init -f
then when tryed to run
npm install --save-dev nodemon
And that was the result:
npm ERR! code ENOVERSIONS
npm ERR! No valid versions available for timed-out
I've just update my node version to the latest one and so npm tools.
node --version -> v8.9.4
npm --version -> 5.6.0
The funny part is that I've done this same steps in another computer 2 days ago with no problem.
325 verbose stack timed-out: No valid versions available for timed-out
325 verbose stack at pickManifest (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\npm-pick-manifest\index.js:20:11)
325 verbose stack at fetchPackument.then.packument (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\lib\fetchers\registry\manifest.js:39:14)
325 verbose stack at tryCatcher (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
325 verbose stack at Promise._settlePromiseFromHandler (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:512:31)
325 verbose stack at Promise._settlePromise (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:569:18)
325 verbose stack at Promise._settlePromise0 (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:614:10)
325 verbose stack at Promise._settlePromises (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:693:18)
325 verbose stack at Async._drainQueue (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:133:16)
325 verbose stack at Async._drainQueues (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:143:10)
325 verbose stack at Immediate.Async.drainQueues (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:17:14)
325 verbose stack at runCallback (timers.js:789:20)
325 verbose stack at tryOnImmediate (timers.js:751:5)
325 verbose stack at processImmediate [as _immediateCallback] (timers.js:722:5)
326 verbose cwd E:\githubprojects\my-project\server
327 verbose Windows_NT 10.0.16299
328 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save-dev" "nodemon#v1.14.7"
329 verbose node v8.9.4
330 verbose npm v5.6.0
331 error code ENOVERSIONS
332 error No valid versions available for timed-out
333 verbose exit [ 1, true ]
Official issue: https://github.com/npm/registry/issues/255
Official status: https://status.npmjs.org/incidents/41zfb8qpvrdj
Several packages including "require-from-string" are currently unavailable. We are aware of the issue and are working to restore the affected user and packages. Please do not attempt to republish packages, as this will hinder our progress in restoring them.
Update from NPM:
Resolved
We apologize for the temporary unavailability of some packages. We will be publishing a comprehensive post-mortem update in the next few days.
Posted Jan 06, 2018 - 23:14 UTC
timed-out is a npm package that is apparently missing, as of the last day, or hour, or minutes (I don't know the time span).
/Users/Stan ==> npm install timed-out -g
npm ERR! code ENOVERSIONS
npm ERR! No valid versions available for timed-out
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/Stan/.npm/_logs/2018-01-06T20_26_40_854Z-debug.log
Now it is working.
/Users/Stan ==> npm install timed-out -g
+ timed-out#4.0.1
added 1 package in 1.306s
It's not you, it's an already known issue, due to dependency problems.
More details here https://github.com/remy/nodemon/issues/1210
Users are reporting that packages are being made available again. Try again and see if your issue is resolved.
https://github.com/npm/registry/issues/255

E404 when trying to link local npm module

I am getting a 404 error when trying to link a local module with npm following the docs
Inside the local module directory seems like it creates a global link correctly:
$ npm link
/usr/local/lib/node_modules/my-module-name -> /Users/XXX/my-module-directory/my-module-name
But when just after that I try to link this from other project directory i get an 404 error:
$ npm link my-module-name
npm ERR! code E404
npm ERR! 404 Not Found: my-module-name#latest
I've tried to unlink the module and link again or change versions but it doesn't work.
Here is full log:
0 info it worked if it ends with ok
1 verbose cli [ '/Users/XXX/.nvm/versions/node/v8.2.1/bin/node',
1 verbose cli '/Users/XXX/.nvm/versions/node/v8.2.1/bin/npm',
1 verbose cli 'link',
1 verbose cli 'my-module-name' ]
2 info using npm#5.3.0
3 info using node#v8.2.1
4 verbose npm-session 7d82e8d8dc1bdc83
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 404 https://registry.npmjs.org/my-module-name 2304ms
8 silly fetchPackageMetaData error for my-module-name#latest 404 Not Found: my-module-name#latest
9 verbose stack Error: 404 Not Found: my-module-name#latest
9 verbose stack at fetch.then.res (/Users/XXX/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/pacote/lib/fetchers/registry/fetch.js:41:19)
9 verbose stack at tryCatcher (/Users/XXX/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
9 verbose stack at Promise._settlePromiseFromHandler (/Users/XXX/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:512:31)
9 verbose stack at Promise._settlePromise (/Users/XXX/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
9 verbose stack at Promise._settlePromise0 (/Users/XXX/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
9 verbose stack at Promise._settlePromises (/Users/XXX/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
9 verbose stack at Async._drainQueue (/Users/XXX/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:133:16)
9 verbose stack at Async._drainQueues (/Users/XXX/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:143:10)
9 verbose stack at Immediate.Async.drainQueues (/Users/XXX/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:17:14)
9 verbose stack at runCallback (timers.js:781:20)
9 verbose stack at tryOnImmediate (timers.js:743:5)
9 verbose stack at processImmediate [as _immediateCallback] (timers.js:714:5)
10 verbose cwd /Users/XXX/my-project-directory
11 verbose Darwin 16.6.0
12 verbose argv "/Users/XXX/.nvm/versions/node/v8.2.1/bin/node" "/Users/XXX/.nvm/versions/node/v8.2.1/bin/npm" "link" "my-module-name"
13 verbose node v8.2.1
14 verbose npm v5.3.0
15 error code E404
16 error 404 Not Found: my-module-name#latest
17 verbose exit [ 1, true ]
You're using an NVM-installed version of Node.js to run npm link my-module-name, but you didn't run npm link (in your module's directory) using that same version.
The initial link is created in /usr/local/lib/node_modules, but when you use NVM, each Node.js version gets their own "lib" directory, in your example /Users/XXX/.nvm/versions/node/v8.2.1/lib/node_modules, which is a different directory.

getting 400 bad request error while installing webpack npm package

Error Log info :
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Users\wf70\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '--save-dev',
1 verbose cli 'webpack' ]
2 info using npm#5.0.1
3 info using node#v6.10.2
4 silly install loadCurrentTree
5 silly install readLocalPackageData
6 http fetch GET 400 https://registry.npmjs.org/webpack 238ms
7 silly fetchPackageMetaData error for webpack#latest 400 Bad Request ( The data is invalid. ): webpack#latest
8 verbose stack Error: 400 Bad Request ( The data is invalid. ): webpack#latest
8 verbose stack at fetch.then.res (C:\Users\wf70\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\lib\fetchers\registry\fetch.js:36:19)
8 verbose stack at tryCatcher (C:\Users\wf70\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
8 verbose stack at Promise._settlePromiseFromHandler (C:\Users\wf70\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:512:31)
8 verbose stack at Promise._settlePromise (C:\Users\wf70\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:569:18)
8 verbose stack at Promise._settlePromise0 (C:\Users\wf70\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:614:10)
8 verbose stack at Promise._settlePromises (C:\Users\wf70\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:693:18)
8 verbose stack at Async._drainQueue (C:\Users\wf70\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:133:16)
8 verbose stack at Async._drainQueues (C:\Users\wf70\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:143:10)
8 verbose stack at Immediate.Async.drainQueues (C:\Users\wf70\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:17:14)
8 verbose stack at runCallback (timers.js:666:20)
8 verbose stack at tryOnImmediate (timers.js:639:5)
8 verbose stack at processImmediate [as _immediateCallback] (timers.js:611:5)
9 verbose cwd D:\2017\ReactJSProject
10 verbose Windows_NT 6.1.7601
11 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Users\wf70\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "--save-dev" "webpack"
12 verbose node v6.10.2
13 verbose npm v5.0.1
14 error code E400
15 error 400 Bad Request ( The data is invalid. ): webpack#latest
16 verbose exit [ 1, true ]
Try the Below :
Option 1
Open Command prompt as admin
npm uninstall -g webpack#latest
npm cache clean
npm config set strict-ssl false
npm install -g webpack#latest
OR :
Option 2
Open Command prompt as admin
npm uninstall -g webpack#latest
npm cache clean
npm config set proxy="http://proxy.example.com:8080"
npm config set https-proxy="http://proxy.example.com:8080"
npm config set strict-ssl false
npm install -g webpack#latest
If you get the error reason: write EPROTO try,
npm config set proxy="http://proxy.example.com:8080"
npm config set https-proxy="http://proxy.example.com:8080"
Follow Option 2
If all the above fails try to install the latest stable version of node & npm.

Resources