Hem*_*dra 7 node.js npm reactjs npm-install npm-start
我在 npm 全局配置中设置了一个代理。在安装任何软件包时,我收到以下错误。下面是我的节点和 npm 版本: npm: 6.13.4 node: v12.16.1
由于我支持代理,因此还需要什么来克服这个问题。每一个帮助将不胜感激。我也尝试过更新节点版本,删除并重新启动设置代理,但都没有奏效。
C:\test>npm i level-db-helper
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! <https://npm.community>
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\user\AppData\Roaming\npm-cache\_logs\2020-03-03T04_51_02_995Z-debug.log
C:\test>npm get proxy
http://my-proxy.com:8080
C:\test>npm get https-proxy
http://my-proxy.com:8080
C:\test>
Run Code Online (Sandbox Code Playgroud)
下面是我的日志文件内容
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 'i',
1 verbose cli 'level-db-helper'
1 verbose cli ]
2 info using npm@6.13.4
3 info using node@v12.16.1
4 verbose npm-session b2d05546852e6399
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 timing npm Completed in 3615ms
8 error cb() never called!
9 error This is an error with npm itself. Please report this error at:
10 error <https://npm.community>
Run Code Online (Sandbox Code Playgroud)
最后我通过自己的研究找到了这个问题的罪魁祸首,这是由于无法访问代理 url,所以在通过以下命令更改 npm 代理和 https-proxy 后,我解决了这个问题。
(您需要管理权限才能执行此命令)
npm config set proxy http://your-proxy-url.com:PORT_NUMBER
npm config set https-proxy http://your-proxy-url.com:PORT_NUMBER
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
15880 次 |
| 最近记录: |