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

你可能感兴趣的:(weex)