简体   繁体   中英

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM