npm install 时遇到的 python 问题

展开阅读全文

npm install python报错

09-17

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.12.0 (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 "python2.7", 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:484:19) gyp ERR! stack at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:509: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) gyp ERR! System Windows_NT 10.0.17134 gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\Users\\78472\\Desktop\\vue-multi-page\\node_modules\\node-zopfli\\lib\\binding\\node-v57-win32-x64\\zopfli.node" "--module_name=zopfli" "--module_path=C:\\Users\\78472\\Desktop\\vue-multi-page\\node_modules\\node-zopfli\\lib\\binding\\node-v57-win32-x64" "--python=python2.7" "--msvs_version=2015" gyp ERR! cwd C:\Users\78472\Desktop\vue-multi-page\node_modules\node-zopfli gyp ERR! node -v v8.12.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\78472\Desktop\vue-multi-page\node_modules\node-zopfli\lib\binding\node-v57-win32-x64\zopfli.node --module_name=zopfli --module_path=C:\Users\78472\Desktop\vue-multi-page\node_modules\node-zopfli\lib\binding\node-v57-win32-x64 --python=python2.7 --msvs_version=2015' (1) node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:\Users\78472\Desktop\vue-multi-page\node_modules\node-pre-gyp\lib\util\compile.js:83:29) node-pre-gyp ERR! stack at emitTwo (events.js:126:13) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:214:7) node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:915:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5) node-pre-gyp ERR! System Windows_NT 10.0.17134 node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\78472\\Desktop\\vue-multi-page\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd C:\Users\78472\Desktop\vue-multi-page\node_modules\node-zopfli node-pre-gyp ERR! node -v v8.12.0 node-pre-gyp ERR! node-pre-gyp -v v0.6.39 node-pre-gyp ERR! not ok 以上是错误内容 问答

安装npm install出现错误

08-23

我是在win8上面操作,需要在github上面克隆一个项目在本地编辑 在nodejs官网上面下载了一个安装包,安装后进行了如下操作 1:新建了一个文件夹,用virtualenv做成虚拟环境 2:将github上面的项目clone到该文件夹 3:将该文件夹进入venv虚拟环境 4:安装Python的依赖包flask之类的 5:进入项目的static文件夹,(这里面有package.json文件,dependencies里有一项是"sass-loader": "^2.0.0",) 输入了如下命令:npm install 错误如下: ``` Building: C:\Program Files\nodejs\node.exe node_modules\pangyp\bin\node-gyp rebuild --libsass_ext= --libsass_cflags= --libsa ss_ldflags= --libsass_library= gyp WARN install got an error, rolling back install gyp ERR! configure error gyp ERR! stack Error: node-v0.12.7.tar.gz local checksum 88bc1dbe3f1da75a4b5eabea55ab1f40a99373b8ae7356d2374e8053ced04ec0 no 42e53067127a5061415be7e12f39d gyp ERR! stack at deref (E:\project1_2\shijuan\node_modules\node-sass\node_modules\pangyp\lib\install.js:304:20) gyp ERR! stack at Request.<anonymous> (E:\project1_2\shijuan\node_modules\node-sass\node_modules\pangyp\lib\install.js:3 gyp ERR! stack at Request.emit (events.js:129:20) gyp ERR! stack at IncomingMessage.<anonymous> (E:\project1_2\shijuan\node_modules\node-sass\node_modules\pangyp\node_mod gyp ERR! stack at IncomingMessage.emit (events.js:129:20) gyp ERR! stack at _stream_readable.js:908:16 gyp ERR! stack at process._tickCallback (node.js:355:11) gyp ERR! System Windows_NT 6.3.9600 gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "E:\\project1_2\\shijuan\\node_modules\\node-sass\\node_modules\\pang ibsass_cflags=" "--libsass_ldflags=" "--libsass_library=" gyp ERR! cwd E:\project1_2\shijuan\node_modules\node-sass gyp ERR! node -v v0.12.7 gyp ERR! pangyp -v v2.3.0 gyp ERR! not ok Build failed ``` 不知道是哪个地方的原因,希望各位老师不吝赐教,谢谢 问答

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览