开发者问题收集

无法通过 npm 安装 create-react-app

2018-09-01
702

我使用以下代码安装 create-react-app

npm install -g create-react-app

我得到了

error 500:
npm ERR! code E500
npm ERR! 500 Internal Server Error: create-react-app@latest

完整错误日志:

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 [email protected]
3 info using [email protected]
4 verbose npm-session 6a3b73048c509207
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 500 http://registry.npmjs.org/create-react-app 70467ms attempt #3
8 silly fetchPackageMetaData error for create-react-app@latest 500 Internal Server Error: create-react-app@latest
9 timing stage:rollbackFailedOptional Completed in 2ms
10 timing stage:runTopLevelLifecycles Completed in 71028ms
11 verbose stack Error: 500 Internal Server Error: create-react-app@latest
11 verbose stack     at fetch.then.res (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\lib\fetchers\registry\fetch.js:42:19)
11 verbose stack     at tryCatcher (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
11 verbose stack     at Promise._settlePromiseFromHandler (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:512:31)
11 verbose stack     at Promise._settlePromise (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:569:18)
11 verbose stack     at Promise._settlePromise0 (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:614:10)
11 verbose stack     at Promise._settlePromises (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:693:18)
11 verbose stack     at Async._drainQueue (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:133:16)
11 verbose stack     at Async._drainQueues (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:143:10)
11 verbose stack     at Immediate.Async.drainQueues [as _onImmediate] (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:17:14)
11 verbose stack     at runCallback (timers.js:693:18)
11 verbose stack     at tryOnImmediate (timers.js:664:5)
11 verbose stack     at processImmediate (timers.js:646:5)
12 verbose cwd E:\web-dev\node-js
13 verbose Windows_NT 10.0.17134
14 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "create-react-app"
15 verbose node v10.9.0
16 verbose npm  v6.2.0
17 error code E500
18 error 500 Internal Server Error: create-react-app@latest
19 verbose exit [ 1, true ]

我尝试了大多数错误解决技术,例如:

npm cache clean --force

此外,我还卸载了节点并安装了最新版本的 Node 10.1。我还将 ssl 设置为 false,但这也无济于事。

1个回答

我运行:

npm install -g create-react-app

并看到:

+ [email protected]
added 67 packages from 20 contributors in 10.728s

请再试一次。

我的建议是 yarn

它比 npm 更快。

hong4rc
2018-09-03