解決 Tried to download(403): 。。。zopfli-v2.0.2 原

npm install一份vux cli代碼,報錯如下(只摘取部分信息)

> [email protected] install D:\項目c\201708監控系統\code\ewater-monitor-app2\node_modules\node-zopfli
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(403): https://node-zopfli.s3.amazonaws.com/Release/zopfli-v2.0.2-node-v57-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v57 ABI, unknown) (falling back to source compile with node-gyp)
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:152:21)

網上搜了很多方法,例如裝python,裝npm install --global --production windows-build-tools,等等,都無效

 

後來發現問題在於node-zopfli,而node-zopfli是compression-webpack-plugin(此時用的版本是0.3.2)引用的依賴,compression-webpack-plugin最新版本是2.0.0,換到最新版後,問題解決,因爲compression-webpack-plugin 2.0.0沒有依賴node-zopfli

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章