我已经挣扎了几个星期了。直到最后,我的搜索都没有帮助安装phonegap。下面是我试图安装它时所显示的内容:
D:\USERS\haraujo>npm -g install phonegap
npm WARN engine ncallbacks@1.0.0: wanted: {"node":"~0.6.7"} (current: {"node":"0
.12.5","npm":"2.11.2"})
|
> cordova@2.7.4 install D:\USERS\haraujo\AppData\Roaming\npm\node_modules\phoneg
ap\node_modules\cordova
> node bootstrap.js
shell.js: internal error
Error: ENOENT, no such file or directory 'D:\USERS\haraujo\AppData\Roaming\npm\n
ode_modules\phonegap\node_modules\cordova\D:'
at Error (native)
at Object.fs.mkdirSync (fs.js:747:18)
at mkdirSyncRecursive (D:\USERS\haraujo\AppData\Roaming\npm\node_modules\pho
negap\node_modules\cordova\node_modules\shelljs\shell.js:1629:8)
at mkdirSyncRecursive (D:\USERS\haraujo\AppData\Roaming\npm\node_modules\pho
negap\node_modules\cordova\node_modules\shelljs\shell.js:1634:3)
at mkdirSyncRecursive (D:\USERS\haraujo\AppData\Roaming\npm\node_modules\pho
negap\node_modules\cordova\node_modules\shelljs\shell.js:1634:3)
at mkdirSyncRecursive (D:\USERS\haraujo\AppData\Roaming\npm\node_modules\pho
negap\node_modules\cordova\node_modules\shelljs\shell.js:1634:3)
at mkdirSyncRecursive (D:\USERS\haraujo\AppData\Roaming\npm\node_modules\pho
negap\node_modules\cordova\node_modules\shelljs\shell.js:1634:3)
at mkdirSyncRecursive (D:\USERS\haraujo\AppData\Roaming\npm\node_modules\pho
negap\node_modules\cordova\node_modules\shelljs\shell.js:1634:3)
at mkdirSyncRecursive (D:\USERS\haraujo\AppData\Roaming\npm\node_modules\pho
negap\node_modules\cordova\node_modules\shelljs\shell.js:1634:3)
at mkdirSyncRecursive (D:\USERS\haraujo\AppData\Roaming\npm\node_modules\pho
negap\node_modules\cordova\node_modules\shelljs\shell.js:1634:3)
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs
\\node_modules\\npm\\bin\\npm-cli.js" "-g" "install" "phonegap"
npm ERR! node v0.12.5
npm ERR! npm v2.11.2
npm ERR! code ELIFECYCLE
npm ERR! cordova@2.7.4 install: `node bootstrap.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the cordova@2.7.4 install script 'node bootstrap.js'.
npm ERR! This is most likely a problem with the cordova package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node bootstrap.js
npm ERR! You can get their info via:
npm ERR! npm owner ls cordova
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! D:\USERS\haraujo\npm-debug.log我需要安装这个来测试移动设备的混合开发。
更新:
通过Git,我成功地克隆了phonegap,cordova-cli,引导程序,并尝试在没有-g标志的情况下再次安装。收到以下消息:
D:\USERS\haraujo>npm install phonegap-cli
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs
\\node_modules\\npm\\bin\\npm-cli.js" "install" "phonegap-cli"
npm ERR! node v0.12.5
npm ERR! npm v2.11.2
npm ERR! code ECONNRESET
npm ERR! network tunneling socket could not be established, cause=Parse Error
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settin
gs.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! Please include the following file with any support request:
npm ERR! D:\USERS\haraujo\npm-debug.log发布于 2015-07-17 02:26:14
我写下了我为我自己的PhoneGap安装所做的所有事情(这是成功的)。
net use n: \\mycomputer\c$\some\really\long\path\Node.js\
c:
cd \users\Me\AppData\roaming\npm\bin
npm install -g phonegap
(manually had to fix failed native Microsoft projects since I have two Visual Studio installs)
n:
cd heroku
phonegap create MyAppName希望这能有所帮助。将驱动器映射到深子目录结构有时会有所帮助,因为Microsoft的最大路径长度大约为260个字符。
更新以匹配您的新错误:
尝试:"npm安装-g phonegap-cli“
发布于 2015-07-16 02:18:58
在Windows上,如果您是标准用户,则通常限制您写入程序文件区域。
注意到这部分错误:
argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "-g" "install" "phonegap"...it看起来像是在那里寻找节点和npm。
您可以尝试以管理员身份启动命令提示符,然后查看是否可以再次安装: npm -g安装phonegap。
在搜索区域中启动->类型"cmd“,然后右键单击命令提示符,然后选择
发布于 2015-07-17 18:54:28
我也收到了同样的错误。
在发出'npm @ -g‘命令之前,我将node_modules下的当前目录更改为npm目录,它工作了。请见下文:
set APPDATA=D:\mobile\appdata
(my nodejs installed to D:\mobile\nodejs)
(my npm installed to D:\mobile\nodejs\node_modules\npm)
(So, moved my current directory as follows)
cd D:\mobile\nodejs\node_modules\npm
npm install -g phonegap@latest如果对你有用的话请告诉我。
https://stackoverflow.com/questions/31430756
复制相似问题