npm install一份vux cli代码,报错如下(只摘取部分信息)
> node-zopfli@2.0.2 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 node-zopfli@2.0.2 and node@8.11.4 (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. (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