Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于npm的错误 #134

Open
deepthan opened this issue Feb 22, 2021 · 0 comments
Open

关于npm的错误 #134

deepthan opened this issue Feb 22, 2021 · 0 comments

Comments

@deepthan
Copy link
Owner

关于npm的错误解决办法

npm 连接错误或者设置了代理

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i"
npm ERR! node v7.7.1
npm ERR! npm  v4.1.2
npm ERR! code ECONNRESET
npm ERR! errno ECONNRESET
npm ERR! syscall read

npm ERR! network read ECONNRESET
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is 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'

其实是版本不支持了,直接更新版本:

window + r
cmd 
cnpm install npm@latest -g

npm使用方法:

  • 获得当前设置的代理
npm config get proxy
  • 给npm设置代理
npm config set registry http://registry.npmjs.org/
  • 移除代理
npm config rm proxy
  • 清除缓存
npm cache clean

下载文件出现 ‘Unexpected end of JSON’

Unexpected end of JSON input while parsing near '...,"dist":{"shasum":"49'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Program Files\nodejs\node_cache\_logs\2017-09-26T14_37_55_039Z-debug.log

运行如下代码删除缓存

npm cache clean --force
或
npm cache clean 

npm 下载包和删除包

npm uninstall --save @angular
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant