我是phonegap的新手,我试图在我的mac机器上安装它,但是我收到了一个错误。我关注this link作为参考。
这是我在mac机器上运行的代码。
./create ~/desktop/hello com.test.hello hello and i am getting error as:
./create: line 66: dirname: command not found
/Users/administrator/Desktop/phonegap-2.9.0/lib/ios/bin/replaces: line 28: sed: command not found
/Users/administrator/Desktop/phonegap-2.9.0/lib/ios/bin/replaces: line 28: sed: command not found
/Users/administrator/Desktop/phonegap-2.9.0/lib/ios/bin/replaces: line 28: sed: command not found
/Users/administrator/Desktop/phonegap-2.9.0/lib/ios/bin/replaces: line 28: sed: command not found
/Users/administrator/Desktop/phonegap-2.9.0/lib/ios/bin/replaces: line 28: sed: command not found
/Users/administrator/Desktop/phonegap-2.9.0/lib/ios/bin/replaces: line 28: sed: command not found
/Users/administrator/Desktop/phonegap-2.9.0/lib/ios/bin/replaces: line 28: sed: command not found
/Users/administrator/Desktop/phonegap-2.9.0/lib/ios/bin/replaces: line 28: sed: command not found
/Users/administrator/Desktop/phonegap-2.9.0/lib/ios/bin/replaces: line 28: sed: command not found
./create: /Users/administrator/Desktop/phonegap-2.9.0/lib/ios/bin/update_cordova_subproject: /usr/bin/python: bad interpreter: No such file or directory
虽然hello.xcodeproj是在给定路径下创建的,但是当我尝试在Xcode中打开它时会出现此错误:
Project /Users/administrator/Desktop/hello/hello.xcodeproj cannot be opened because the project file cannot be parsed.
任何帮助将不胜感激。
答案 0 :(得分:2)
似乎没有正确安装phonegap。 最简单的方法是首先从nodejs.org下载node-js然后使用它的包管理器来安装phonegap。
sudo npm install -g phonegap
安装phonegap后,您可以使用
phonegap local create com.test.hello hello
初始化您的项目