Phonegap安装

时间:2013-11-12 10:58:14

标签: cordova titanium

您好我要在我的MAC OSX 10.9上安装phonegap 在我的机器上安装Appcelerator Titanium之前,由于某些原因我删除了它。

我的机器上安装了Node和NPM,我使用以下方法安装了phonegap:

  
    

$ sudo npm install -g phonegap

  

然后在安装phonegap之后这是一个奇怪的事情:

它在我的应用程序中创建了一个Titanium Studio文件夹。 如果您知道如何解决此问题,请回复。我无法在我的机器上运行phonegap。

  
    

npm http GET https://registry.npmjs.org/mime/1.2.6     npm http 304 https://registry.npmjs.org/mime/1.2.6     / Applications / Titanium Studio / TitaniumStudio.app / Contents / MacOS / Password:/ usr / local / bin / phonegap - > / Applications / Titanium Studio / TitaniumStudio.app / Contents / MacOS / Password:/usr/local/lib/node_modules/phonegap/bin/phonegap.js     phonegap@3.1.0-0.15.0 / Applications / Titanium Studio / TitaniumStudio.app / Contents / MacOS /密码:/ usr / local / lib / node_modules / phonegap

  

2 个答案:

答案 0 :(得分:0)

运行npm get prefix将显示当前prefix设置,该设置可能同时包含Titanium和phonegap目录。 npm set prefix /usr/local/bin/phonegap可能会为您解决此问题。

答案 1 :(得分:-1)

执行npm -g install phonegap后 输出: 200 https://registry.npmjs.org/keypress / Applications / Titanium Studio / TitaniumStudio.app / Contents / MacOS / Password:/ Applications / Titanium Studio / TitaniumStudio.app / Contents / MacOS / Password:/ usr / local / bin / phonegap - > / Applications / Titanium Studio / TitaniumStudio.app / Contents / MacOS / Password:/ Applications / Titanium Studio / TitaniumStudio.app / Contents / MacOS / Password:/usr/local/lib/node_modules/phonegap/bin/phonegap.js phonegap@3.3.0-0.18.0 / Applications / Titanium Studio / TitaniumStudio.app / Contents / MacOS /密码:/ Applications / Titanium Studio / TitaniumStudio.app / Contents / MacOS /密码:/ usr / local / lib / node_modules / PhoneGap的

我安装了Titanium Studio(appcelerator),它也使用了node.js.

执行npm get前缀后 / Applications / Titanium Studio / TitaniumStudio.app / Contents / MacOS /密码:/ Applications / Titanium Studio / TitaniumStudio.app / Contents / MacOS /密码:/ usr / local

哪个npm 的/ usr / local / bin中/ NPM

执行npm set前缀/ usr / local / bin / phonegap后,似乎没有发生任何事情,但请重试 npm获取前缀然后

npm ERR!错误:EACCES,mkdir'/ usr / local / bin / phonegap' 错误的ERR! {[错误:EACCES,mkdir'/ usr / local / bin / phonegap']错误号:3,代码:'EACCES',路径:'/ usr / local / bin / phonegap'} 错误的ERR! 错误的ERR!请尝试以root / Administrator方式再次运行此命令。

npm ERR!系统达尔文13.0.0 错误的ERR!命令“node”“/ usr / local / bin / npm”“get”“prefix” 错误的ERR! cwd / Users / Sweetcoder 错误的ERR! node -v v0.10.23 错误的ERR! npm -v 1.3.17 错误的ERR!路径/ usr / local / bin / phonegap 错误的ERR!代码EACCES 错误的ERR!错误3 错误的ERR!堆栈错误:EACCES,mkdir'/ usr / local / bin / phonegap' 错误的ERR! 错误的ERR!其他记录详细信息可在以下位置找到 错误的ERR! /Users/Sweetcoder/npm-debug.log 错误的ERR!不好的代码0 MacBook-Pro-de-Javier:~Fredcoder $ npm获取前缀 错误的ERR!错误:EACCES,mkdir'/ usr / local / bin / phonegap' 错误的ERR! {[错误:EACCES,mkdir'/ usr / local / bin / phonegap']错误号:3,代码:'EACCES',路径:'/ usr / local / bin / phonegap'} 错误的ERR! 错误的ERR!请尝试以root / Administrator方式再次运行此命令。

npm ERR!系统达尔文13.0.0 错误的ERR!命令“node”“/ usr / local / bin / npm”“get”“prefix” 错误的ERR! cwd / Users / Sweetcoder 错误的ERR! node -v v0.10.23 错误的ERR! npm -v 1.3.17 错误的ERR!路径/ usr / local / bin / phonegap 错误的ERR!代码EACCES 错误的ERR!错误3 错误的ERR!堆栈错误:EACCES,mkdir'/ usr / local / bin / phonegap' 错误的ERR! 错误的ERR!其他记录详细信息可在以下位置找到 错误的ERR! /Users/Sweetcoder/npm-debug.log 错误的ERR!不好的代码0

然后使用sudo nom get前缀重试: 的/ usr / local / bin中/ PhoneGap的

再次安装phonegap: 现在执行phonegap -bash:phonegap:command not found

然后cd / usr / local / bin / phonegap / bin和phonegap就在那里

执行./phonegap,输出正常

电话空白不在路径

然后问题是de npm的前缀导致Titanium Studio安装。记住npm获取前缀的旧前缀 / Applications / Titanium Studio / TitaniumStudio.app / Contents / MacOS /密码:/ Applications / Titanium Studio / TitaniumStudio.app / Contents / MacOS /密码:/ usr / local

将前缀设置为/ usr / local并尝试重新安装phonegap

NPM install -g not working after Titanium install

可能会出现拒绝删除的消息:/ usr / local / bin / phonegap不在/ usr / local / lib / node_modules / phonegap

别担心,exec / usr / local / bin / phonegap

然后你会看到你可以执行phonegap命令

如果我在使用Titanium更新时遇到问题,我将编辑此帖子

相关问题