npm安装依赖包报错

最近在新下载了一个项目,需要 npm i 下载依赖,,但是一直报错,,
首先用cnpm源下载

$ npm install -g npm
npm ERR! code E500
npm ERR! 500 Internal Privoxy Error: npm@latest
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\zt\AppData\Roaming\npm-cache_logs\2018-09-11T01_15_45_539Z-debug.log

换成npm源

$ npm i
npm ERR! code ECONNRESET
npm ERR! errno ECONNRESET
npm ERR! network request to https://registry.npmjs.org/typescript/-/typescript-2.9.2.tgz failed, reason: socket hang up
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\zt\AppData\Roaming\npm-cache_logs\2018-09-11T01_54_12_546Z-debug.log

于是百度
https://segmentfault.com/q/1010000006696165,找到了这篇文章

这里写图片描述

于是我想到了我之前好像设置了网路代理
于是跟着做了一下,,果不其然
这里写图片描述
设置完之后重新npm i

$ npm i
[email protected] install E:\2018\ionic4-sidemenu\node_modules\node-sass
node scripts/install.js
Downloading binary from https://github.com/sass/node-sass/releases/download/v4.9.3/win32-x64-57_binding.node
Download complete
Binary saved to E:\2018\ionic4-sidemenu\node_modules\node-sass\vendor\win32-x64-57\binding.node
Caching binary to C:\Users\zt\AppData\Roaming\npm-cache\node-sass\4.9.3\win32-x64-57_binding.node
[email protected] postinstall E:\2018\ionic4-sidemenu\node_modules\node-sass
node scripts/build.js
Binary found at E:\2018\ionic4-sidemenu\node_modules\node-sass\vendor\win32-x64-57\binding.node
Testing binary
Binary is fine
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {“os”:”darwin”,”arch”:”any”} (current: {“os”:”win32”,”arch”:”x64”})
added 1136 packages in 435.919s

猜你喜欢

转载自blog.csdn.net/z15802933724/article/details/82623482