最近拉一個項目代碼安裝依賴遇到報錯足丢,本應(yīng)該安裝在node_modules目錄下的文件全安裝到node_modules/.staging目錄下了上荡,在這邊記錄一下解決方法
報錯信息:
npm WARN tar zlib error: unexpected end of file
npm ERR! cb() never called!
解決方法:
npm cache clean --force
npm install --no-package-lock
參數(shù) --no-package-lock 將阻止 npm 創(chuàng)建 package-lock.json 文件淤袜,這個錯誤估計與這個文件的存在有關(guān)。
node v.8.11.3 npm v.5.6.0
如果出現(xiàn)下面的錯誤:
npm ERR cb() never called
可能是緩存的問題掌腰,清除緩存看看
sudo npm cache verify