2015-12-21 95 views
0

我正在关注这个tutorial安装phonegap。我的电脑是Windows 7 64位。无法安装Phonegap:gyp ERR!配置错误

但是,当我在上述教程的第4步中运行npm install -g phonegap时,出现错误。在CMD中显示的错误都低于

> [email protected] install C:\Users\Yohan\AppData\Roaming\npm\node_modules\phonegap\nod 
e_modules\connect-phonegap\node_modules\socket.io\node_modules\engine.io\node_mo 
dules\ws 
> (node-gyp rebuild 2> builderror.log) || (exit 0) 

/
C:\Users\Yohan\AppData\Roaming\npm\node_modules\phonegap\node_modules\connect-ph 
onegap\node_modules\socket.io\node_modules\engine.io\node_modules\ws>if not defi 
ned npm_config_node_gyp (node "C:\Program Files (x86)\nodejs\node_modules\npm\bi 
n\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild) else (no 
de rebuild) 

> [email protected] install C:\Users\Yohan\AppData\Roaming\npm\node_modules\phonegap\nod 
e_modules\connect-phonegap\node_modules\socket.io\node_modules\socket.io-client\ 
node_modules\engine.io-client\node_modules\ws 
> (node-gyp rebuild 2> builderror.log) || (exit 0) 

| 
C:\Users\Yohan\AppData\Roaming\npm\node_modules\phonegap\node_modules\connect-ph 
onegap\node_modules\socket.io\node_modules\socket.io-client\node_modules\engine. 
io-client\node_modules\ws>if not defined npm_config_node_gyp (node "C:\Program F 
iles (x86)\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp 
\bin\node-gyp.js" rebuild) else (node rebuild) 
^CTerminate batch job (Y/N)? y 

builderror.log文件包含以下信息。

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 (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:116:14) 
gyp ERR! stack  at C:\Program Files (x86)\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 6.1.7600 
gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" 
gyp ERR! cwd C:\Users\Yohan\AppData\Roaming\npm\node_modules\phonegap\node_modules\connect-phonegap\node_modules\socket.io\node_modules\socket.io-client\node_modules\engine.io-client\node_modules\ws 
gyp ERR! node -v v4.2.3 
gyp ERR! node-gyp -v v3.0.3 
gyp ERR! not ok 

如何解决此问题并正确安装phonegap?

+0

博客条目有点过时.. Yeah科尔多瓦/ Phonegap现在正在运行Android SDK 23和iOS9,截至几周前。试试这个博客,看看它是否可以帮助你[iPhoneDevlog](https://iphonedevlog.wordpress.com/workflow/)。作者常常[Google网上论坛](https://groups.google.com/forum/#!forum/phonegap)提供更多帮助 – JesseMonroy650

+0

为什么不尝试安装python或设置env-variable PYTHON如果已安装python作为你的错误日志表明? – Blauharley

回答

0

如果可能尝试使用当前稳定版本重新安装node.js。

,然后在命令提示符下

NPM安装-g PhoneGap的最新@

好运

+0

每一件事都是新安装的。什么与Python? –

+0

是,对于节点 - >当前版本:v4.2.3 注意:从源代码tarball构建需要Python 2.6或2.7。请参考:https://nodejs.org/en/download/ –

0

查看以下链接安装的PhoneGap。 Link