我有Windows 10作为主机OS,Ubuntu作为访客的VMWare Player。我正在尝试使用npm i -g create-react-app
,但出现ENOTFOUND错误。从日志中:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'i', '-g', 'create-react-app' ]
2 info using npm@6.4.1
3 info using node@v11.3.0
4 verbose npm-session e354efa206155aae
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData error for create-react-app@latest request to https://registry.npmjs.org/create-react-app failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
8 timing stage:rollbackFailedOptional Completed in 42ms
9 timing stage:runTopLevelLifecycles Completed in 4100ms
10 verbose type system
11 verbose stack FetchError: request to https://registry.npmjs.org/create-react-app failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
11 verbose stack at ClientRequest.req.on.err (/usr/lib/node_modules/npm/node_modules/node-fetch-npm/src/index.js:68:14)
11 verbose stack at ClientRequest.emit (events.js:182:13)
11 verbose stack at TLSSocket.socketErrorListener (_http_client.js:399:9)
11 verbose stack at TLSSocket.emit (events.js:182:13)
11 verbose stack at emitErrorNT (internal/streams/destroy.js:82:8)
11 verbose stack at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
11 verbose stack at process.internalTickCallback (internal/process/next_tick.js:72:19)
12 verbose cwd /home/cloudburst/Documents/MERN-HelloWorld
13 verbose Linux 4.15.0-39-generic
14 verbose argv "/usr/bin/node" "/usr/bin/npm" "i" "-g" "create-react-app"
15 verbose node v11.3.0
16 verbose npm v6.4.1
17 error code ENOTFOUND
18 error errno ENOTFOUND
19 error network request to https://registry.npmjs.org/create-react-app failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
20 error network This is a problem related to network connectivity.
20 error network In most cases you are behind a proxy or have bad network settings.
20 error network
20 error network If you are behind a proxy, please make sure that the
20 error network 'proxy' config is set properly. See: 'npm help config'
21 verbose exit [ 1, true ]
我对代理服务器的配置不满意,但似乎需要将npm的https-proxy
地址更改为我的代理服务器地址或删除代理服务器。这是正确的吗?如果是这样,我如何确认将https-proxy
设置为的地址?