npm install报错

Posted 紫风幻雪

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了npm install报错相关的知识,希望对你有一定的参考价值。

报错的日志:

verbose stack ZlibError: zlib: unexpected end of file
verbose stack     at Zlib.(anonymous function).onerror (C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\minizlib\\index.js:131:21)
verbose stack     at Unzip.write (C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\minizlib\\index.js:255:31)
verbose stack     at Unzip.flush (C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\minizlib\\index.js:222:10)
verbose stack     at Unzip.end (C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\minizlib\\index.js:229:10)
verbose stack     at Object.end (C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\tar\\lib\\parse.js:415:21)
verbose stack     at PassThrough.onend (_stream_readable.js:595:10)
verbose stack     at Object.onceWrapper (events.js:313:30)
verbose stack     at emitNone (events.js:111:20)
verbose stack     at PassThrough.emit (events.js:208:7)
verbose stack     at endReadableNT (_stream_readable.js:1064:12)
verbose stack     at _combinedTickCallback (internal/process/next_tick.js:139:11)
verbose stack     at process._tickCallback (internal/process/next_tick.js:181:9)
verbose cwd D:\\androidStudioWorkSpace\\weex\\weexdemo
verbose Windows_NT 10.0.17134
verbose argv "C:\\\\Program Files\\\\nodejs\\\\node.exe" "C:\\\\Program Files\\\\nodejs\\\\node_modules\\\\npm\\\\bin\\\\npm-cli.js" "install"
verbose node v8.12.0
verbose npm  v6.4.1
error code Z_BUF_ERROR
error errno -5
error zlib: unexpected end of file
verbose exit [ -5, true ]

在网上查了一些资料,先用的的npm cache clean,然而并没有什么用

正确的解决方案:

清理npm使用下面的:

npm cache clean --force

然后:npm install

以上是关于npm install报错的主要内容,如果未能解决你的问题,请参考以下文章

npm install 报错(npm ERR! errno 1)

npm install 报错 --ignore-scripts

npm install报错Error: ENOENT

IDEA运行VUE npm install报错:chromedriver@2.27.2 install: node install.js

IDEA运行VUE npm install报错:chromedriver@2.27.2 install: node install.js

npm install 和npm start各种报错无法解决的问题