1. 程式人生 > >npm安裝依賴包報錯

npm安裝依賴包報錯

最近在新下載了一個專案,需要 npm i 下載依賴,,但是一直報錯,, 首先用cnpm源下載

$ npm install -g npm npm ERR! code E500 npm ERR! 500 Internal Privoxy Error: [email protected] 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

這裡寫圖片描述

於是我想到了我之前好像設定了網路代理 於是跟著做了一下,,果不其然 這裡寫圖片描述 設定完之後重新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