新手急问。。 gyp ERR
发布于 8 年前 作者 55345249 17957 次浏览 来自 问答
"C:\Program Files (x86)\JetBrains\WebStorm 10.0.4\bin\runnerw.exe" "C:\Program Files\nodejs\npm.cmd" update

> kerberos@0.0.16 install C:\Users\55345\WebstormProjects\myblog\node_modules\mongodb\node_modules\mongodb-core\node_modules\kerberos
> node-gyp rebuild


C:\Users\55345\WebstormProjects\myblog\node_modules\mongodb\node_modules\mongodb-core\node_modules\kerberos>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\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 "python", you can set the PYTHON env variable.
gyp ERR! stack     at failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:116:14)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:71:11
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:82:15)
gyp ERR! System Windows_NT 10.0.10240
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\55345\WebstormProjects\myblog\node_modules\mongodb\node_modules\mongodb-core\node_modules\kerberos
gyp ERR! node -v v4.2.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 
npm WARN optional dep failed, continuing kerberos@0.0.16
mongodb@2.0.47 node_modules\mongodb
├── es6-promise@2.1.1
├── readable-stream@1.0.31 (isarray@0.0.1, core-util-is@1.0.1, inherits@2.0.1, string_decoder@0.10.31)
└── mongodb-core@1.2.20 (bson@0.4.19)

Process finished with exit code 0
19 回复

需要我在windows10上,安装一个PYTHON么?

@MiguelValentine 谢谢。而且python有版本要求,高了也不行。。还得重新下载一个低版本的。。 gyp ERR! configure error gyp ERR! stack Error: Python executable “python” is v3.5.0, which is not supported by gyp. gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.

2.7版本的python就可以

@kiroChen 我用的2.7版的,但是又有了新问题。哎。。

“C:\Program Files (x86)\JetBrains\WebStorm 10.0.4\bin\runnerw.exe” “C:\Program Files\nodejs\npm.cmd” update

kerberos@0.0.16 install C:\Users\55345\WebstormProjects\myblog\node_modules\mongodb\node_modules\mongodb-core\node_modules\kerberos node-gyp rebuild

C:\Users\55345\WebstormProjects\myblog\node_modules\mongodb\node_modules\mongodb-core\node_modules\kerberos>if not defined npm_config_node_gyp (node “C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\…\node_modules\node-gyp\bin\node-gyp.js” rebuild ) else (node rebuild ) �ڴ˽��������һ������һ����Ŀ����Ҫ���ò������ɣ�����ӡ�/m�����ء� C:\Users\55345\WebstormProjects\myblog\node_modules\mongodb\node_modules\mongodb-core\node_modules\kerberos\build\kerberos.vcxproj(20,3): error MSB4019: δ�ҵ��������Ŀ��C:\Microsoft.Cpp.Default.props������ȷ�� <Import> �����е�·����ȷ���Ҵ����ϴ��ڸ��ļ��� gyp ERR! build error gyp ERR! stack Error: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:270:23) gyp ERR! stack at emitTwo (events.js:87:13) gyp ERR! stack at ChildProcess.emit (events.js:172:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12) gyp ERR! System Windows_NT 10.0.10240 gyp ERR! command “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js” "rebuild" gyp ERR! cwd C:\Users\55345\WebstormProjects\myblog\node_modules\mongodb\node_modules\mongodb-core\node_modules\kerberos gyp ERR! node -v v4.2.1 gyp ERR! node-gyp -v v3.0.3 gyp ERR! not ok npm WARN optional dep failed, continuing kerberos@0.0.16 mongodb@2.0.47 node_modules\mongodb ├── es6-promise@2.1.1 ├── readable-stream@1.0.31 (string_decoder@0.10.31, core-util-is@1.0.1, isarray@0.0.1, inherits@2.0.1) └── mongodb-core@1.2.20 (bson@0.4.19)

Process finished with exit code 0

C++编译器装了吗?

@hanyuzhou2006 我放弃了windows。。

少包 换linux or装一个vs2010 express 版本也不能高。。。

我也是同样的问题,装了python2.7.9,vs2013。

G:\web\expressTest\microblog\node_modules\mongodb\node_modules\mongodb-core\node _modules\kerberos>if not defined npm_config_node_gyp (node “C:\Program Files\nod ejs\node_modules\npm\bin\node-gyp-bin\…\node_modules\node-gyp\bin\node-gyp. js” rebuild ) else (node rebuild )

到这就不动了。

重新安装 python试试,最好用Linux开发。

win10 的有正解吗?

:\git\nodejs_tpl\node_modules\ldapauth\node_modules\bcrypt>if not defined npm_config_node_gyp (node “f:\SOFTWARE\Nodejs\install4.1\node_modules\npm\bin\node-gyp-bin\…\node_modules\node-gyp\bin\node-gyp.js” rebuild ) else (node rebuild ) 在此解决方案中一次生成一个项目。若要启用并行生成,请添加“/m”开关。 d:\git\nodejs_tpl\node_modules\ldapauth\node_modules\bcrypt\build\bcrypt_lib.vcxproj(20,3): error MSB4019: 未找到导入的项目“d:\Microsoft.Cpp.Default.props ”。请确认 <Im port> 声明中的路径正确,且磁盘上存在该文件。 gyp ERR! build error gyp ERR! stack Error: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (f:\SOFTWARE\Nodejs\install4.1\node_modules\npm\node_modules\node-gyp\lib\build.js:270:23) gyp ERR! stack at emitTwo (events.js:87:13) gyp ERR! stack at ChildProcess.emit (events.js:172:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12) gyp ERR! System Windows_NT 10.0.10240 gyp ERR! command “f:\SOFTWARE\Nodejs\install4.1\node.exe” “f:\SOFTWARE\Nodejs\install4.1\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js” "rebuild" gyp ERR! cwd d:\git\nodejs_tpl\node_modules\ldapauth\node_modules\bcrypt gyp ERR! node -v v4.1.1 gyp ERR! node-gyp -v v3.0.3 gyp ERR! not ok

求解?

一般windows上需要两样东西,python和c艹环境,所以,安装python2.7和VS2010Express即可,注意版本

玩node真的不建议Windows

@CarlosRen 后来换了 0.12 的node 版本 就好了。

@shirleyYing 我现在5.1.。。完全没压力。。。windows的确是坑 但是可以填啊~

@CarlosRen 你好,装了python2.7.9 ,重新安装mongoose时,还是显示没安装python,是要重新安装node吗?

回到顶部