我正在使用第一个命令创建一个反应应用程序;npm init
然后是第二个npx create-react-app projectName
,但是它给出了这个错误:
npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! network request to http://registry.npmjs.org/create-react-app failed, reason: connect ETIMEDOUT 104.16.22.35:80
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\amrish patidar\AppData\Roaming\npm-cache\_logs\2020-12-17T07_28_05_673Z-debug.log
我的 npm 配置列表如下
npm config list
; cli configs
metrics-registry = "http://registry.npmjs.org/"
scope = ""
user-agent = "npm/6.14.9 node/v14.15.2 win32 x64"
; userconfig C:\Users\amrish patidar\.npmrc
registry = "http://registry.npmjs.org/"
strict-ssl = true
; builtin config undefined
prefix = "C:\\Users\\amrish patidar\\AppData\\Roaming\\npm"
; node bin location = C:\Program Files\nodejs\node.exe
; cwd = C:\Users\amrish patidar
; HOME = C:\Users\amrish patidar
; "npm config ls -l" to show all defaults.
调试日志文件
C:\Users\amrish patidar\AppData\Roaming\npm-cache\_logs\2020-12-17T07_28_05_673Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [
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'
1 verbose cli ]
2 info using npm@6.14.9
3 info using node@v14.15.2
4 verbose config Skipping project config: C:\Users\amrish patidar/.npmrc. (matches userconfig)
5 verbose npm-session c45391ce1f743672
6 silly install loadCurrentTree
7 silly install readLocalPackageData
8 silly fetchPackageMetaData error for create-react-app@latest request to http://registry.npmjs.org/create-react-app failed, reason: connect ETIMEDOUT 104.16.17.35:80
9 timing stage:rollbackFailedOptional Completed in 1ms
10 timing stage:runTopLevelLifecycles Completed in 133456ms
11 verbose type system
12 verbose stack FetchError: request to http://registry.npmjs.org/create-react-app failed, reason: connect ETIMEDOUT 104.16.17.35:80
12 verbose stack at ClientRequest.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\index.js:68:14)
12 verbose stack at ClientRequest.emit (events.js:315:20)
12 verbose stack at Socket.socketErrorListener (_http_client.js:469:9)
12 verbose stack at Socket.emit (events.js:315:20)
12 verbose stack at emitErrorNT (internal/streams/destroy.js:106:8)
12 verbose stack at emitErrorCloseNT (internal/streams/destroy.js:74:3)
12 verbose stack at processTicksAndRejections (internal/process/task_queues.js:80:21)
13 verbose cwd C:\Users\amrish patidar
14 verbose Windows_NT 10.0.19041
15 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "create-react-app"
16 verbose node v14.15.2
17 verbose npm v6.14.9
18 error code ETIMEDOUT
19 error errno ETIMEDOUT
20 error network request to http://registry.npmjs.org/create-react-app failed, reason: connect ETIMEDOUT 104.16.17.35:80
21 error network This is a problem related to network connectivity.
21 error network In most cases you are behind a proxy or have bad network settings.
21 error network
21 error network If you are behind a proxy, please make sure that the
21 error network 'proxy' config is set properly. See: 'npm help config'
22 verbose exit [ 1, true ]