1. 程式人生 > >npm install出錯,npm ERR! code EINTEGRITY npm ERR! Verification failed while extracting

npm install出錯,npm ERR! code EINTEGRITY npm ERR! Verification failed while extracting

npm install時出現以下錯誤:

npm ERR! code EINTEGRITY
npm ERR! Verification failed while extracting url-parse@1.4.3:
npm ERR! Verification failed while extracting url-parse@1.4.3:
npm ERR! sha512-x95Td74QcvICAA0+qERaVkRpTGKyBHHYdwL2LXZm5t/gBtCB9KQSO/0zQgSTYEV1p0WcvSg79TLNPSvd5IDJMQ== integrity checksum failed when using sha512: wanted sha512-x95Td74QcvICAA0
+qERaVkRpTGKyBHHYdwL2LXZm5t/gBtCB9KQSO/0zQgSTYEV1p0WcvSg79TLNPSvd5IDJMQ== but got sha512-rh+KuAW36YKo0vClhQzLLveoj8FwPJNu65xLb7Mrt+eZht0IPT0IXgSv8gcMegZ6NvjJUALf6Mf25POlMwD1Fw==. (13865 bytes) npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache
\_logs\2018-09-15T10_18_02_420Z-debug.log

折騰許久,網上找了好多辦法,有說npm版本太高了,要升級到最新的,有說因為更新包時一會用npm一會用cnpm導致的,其實我一直都只用npm,並且不管是清快取還是升級npm後,都會把舊版本下載的檔案目錄都清空的。 清快取:npm cache verify 執行:npm install -g npm 再執行:npm install -g vue-cli

還是一樣不行,最後,把npm版本降為4.X後,再試,竟然可以了…..

npm -g install [email protected] npm cache verify npm install

搞定~