呃!堆栈错误:尝试在使用Windows 10的克隆存储库上运行npm install时找不到Python可执行文件

时间:2017-10-29 13:27:10

标签: python node.js npm

我刚开始关于udacity节点的教程,我按照教师的指示从git克隆了示例项目,然后我运行了npm install命令,然后我遇到了这些错误

C:\xampp\htdocs\nodejs\offlineweb\wittr>npm install
> bufferutil@1.2.1 install C:\xampp\htdocs\nodejs\offlineweb\wittr\node_modules\bufferutil
> node-gyp rebuild


C:\xampp\htdocs\nodejs\offlineweb\wittr\node_modules\bufferutil>if not defined npm_config_node_gyp (node "C:\Users\Ogbonna Vitalis Pc\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "C:\Users\Ogbonna Vitalis Pc\AppData\Local\Programs\Python\Python35", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (C:\Users\Ogbonna Vitalis Pc\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Users\Ogbonna Vitalis Pc\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack     at C:\Users\Ogbonna Vitalis Pc\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:153:21)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Ogbonna Vitalis Pc\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\xampp\htdocs\nodejs\offlineweb\wittr\node_modules\bufferutil`
gyp ERR! node -v v8.6.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok

utf-8-validate@1.2.2 install C:\xampp\htdocs\nodejs\offlineweb\wittr\node_modules\utf-8-validate
node-gyp rebuild


C:\xampp\htdocs\nodejs\offlineweb\wittr\node_modules\utf-8-validate>if not defined npm_config_node_gyp (node "C:\Users\Ogbonna Vitalis Pc\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "C:\Users\Ogbonna Vitalis Pc\AppData\Local\Programs\Python\Python35", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (C:\Users\Ogbonna Vitalis Pc\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Users\Ogbonna Vitalis Pc\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack     at C:\Users\Ogbonna Vitalis Pc\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:153:21)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Ogbonna Vitalis Pc\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\xampp\htdocs\nodejs\offlineweb\wittr\node_modules\utf-8-validate
gyp ERR! node -v v8.6.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok

我的系统已经有了一个工作的python IDE,我在安装时勾选了添加PYTHON TO PATH。我试过谷歌搜索但没有积极的结果。 请您的建议...

1 个答案:

答案 0 :(得分:1)

我安装了python版本2.7,我勾选了添加env变量的路径,这解决了我的问题