npm安装某些包在windows下遇到的错误

来源:互联网 发布:淘宝服装修图步骤 编辑:程序博客网 时间:2024/05/19 16:35
gyp ERR! configure errorgyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.gyp ERR! stack     at PythonFinder.failNoPython (E:\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:454:19)gyp ERR! stack     at PythonFinder.<anonymous> (E:\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:480:16)gyp ERR! stack     at E:\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:114:15)gyp ERR! System Windows_NT 10.0.15048gyp ERR! command "E:\\nodejs\\node.exe" "E:\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"gyp ERR! cwd G:\gulp-angular\node_modules\bufferutilgyp ERR! node -v v7.7.1gyp ERR! node-gyp -v v3.5.0gyp ERR! not ok> utf-8-validate@1.2.2 install G:\gulp-angular\node_modules\utf-8-validate> node-gyp rebuildG:\gulp-angular\node_modules\utf-8-validate>if not defined npm_config_node_gyp (node "E:\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )gyp ERR! configure errorgyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.gyp ERR! stack     at PythonFinder.failNoPython (E:\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:454:19)gyp ERR! stack     at PythonFinder.<anonymous> (E:\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:480:16)gyp ERR! stack     at E:\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:114:15)gyp ERR! System Windows_NT 10.0.15048gyp ERR! command "E:\\nodejs\\node.exe" "E:\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"gyp ERR! cwd G:\gulp-angular\node_modules\utf-8-validategyp ERR! node -v v7.7.1gyp ERR! node-gyp -v v3.5.0gyp ERR! not ok

这个错误是Windows编译的问题,要解决
一是换Linux,不得不说Linux环境比windows好太多
当然很多人怕麻烦那就只有安装编译环境了,错误说缺少python环境就先装python。装完后,我估计会提醒没有c++的组件继续报错,然后在安装vs就可以了
解决方法:
安装Python2.7 , 安装vs2015社区版


还有向大家提个醒,最好不要在Windows环境下使用sass,需要Ruby环境,很麻烦,我曾经在这个问题上反复打转,最终还是放弃写sass。

0 0