我正在关注这个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?
博客条目有点过时.. Yeah科尔多瓦/ Phonegap现在正在运行Android SDK 23和iOS9,截至几周前。试试这个博客,看看它是否可以帮助你[iPhoneDevlog](https://iphonedevlog.wordpress.com/workflow/)。作者常常[Google网上论坛](https://groups.google.com/forum/#!forum/phonegap)提供更多帮助 – JesseMonroy650
为什么不尝试安装python或设置env-variable PYTHON如果已安装python作为你的错误日志表明? – Blauharley