gpt4 book ai didi

node.js - npm 安装 Reactjs 应用程序 npm 错误!代码 E404

转载 作者:太空宇宙 更新时间:2023-11-03 21:52:14 26 4
gpt4 key购买 nike

我是reactjs新手,我正在尝试创建一个reactjs应用程序,我按照react web上的步骤操作,但它显示错误。我的node版本是v8.11.1.npx版本是9.7.1。

顺便说一句,我可以使用 npx create-react-app 创建应用程序,但是当使用 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

这是日志文件:

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 ]

谢谢。

最佳答案

看起来您在安装时尝试运行 create-react-app。

运行npm install -g create-react-app,尽管它应该已经安装了。

然后运行create-react-app amber-web

<小时/>

编辑:

出现此错误的原因是因为您输入了 npm install -g create-react-app
create-react-app amber_Web
全部在一个命令中,告诉 npm 安装 create-react-app 包两次和 amber_Web 包,但该包不存在,因此出现 404 错误。 * 名称不能再包含大写字母

关于node.js - npm 安装 Reactjs 应用程序 npm 错误!代码 E404,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50732295/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com