我正在關注這個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