我在使用yeoman安装角度cordova应用程序时遇到问题。 (更具体地说是this生成器。)
以下是发生的事情:
$ yo angular-cordova
_-----_
| |
|--(o)--| .--------------------------.
`---------´ | Welcome to Yeoman, |
( _´U`_ ) | ladies and gentlemen! |
/___A___\ '__________________________'
| ~ |
__'.___.'__
´ ` |° ´ Y `
Out of the box I include Ionic and some AngularJS recommended modules.
[?] What is the name of your app? (Spaces aren't allowed) HelloCordova
[?] What would you like the package to be? io.cordova.hellocordova
[?] What platforms would you like to add support for? Android, iOS
[?] What plugins would you like to include by default?
[?] Would you like to copy some sample icons for cordova? Yes
Creating cordova app: helloCordova
/usr/lib/node_modules/generator-angular-cordova/node_modules/cordova/node_modules/q/q.js:126
throw e;
^
Error: ENOENT, no such file or directory '/home/leoha/projects/mobile-app-v2/www/js/index.js'
at Object.fs.unlinkSync (fs.js:760:18)
at /usr/lib/node_modules/generator-angular-cordova/app/index.js:246:16
at _rejected (/usr/lib/node_modules/generator-angular-cordova/node_modules/cordova/node_modules/q/q.js:808:24)
at /usr/lib/node_modules/generator-angular-cordova/node_modules/cordova/node_modules/q/q.js:834:30
at Promise.when (/usr/lib/node_modules/generator-angular-cordova/node_modules/cordova/node_modules/q/q.js:1079:31)
at Promise.promise.promiseDispatch (/usr/lib/node_modules/generator-angular-cordova/node_modules/cordova/node_modules/q/q.js:752:41)
at /usr/lib/node_modules/generator-angular-cordova/node_modules/cordova/node_modules/q/q.js:821:14
at flush (/usr/lib/node_modules/generator-angular-cordova/node_modules/cordova/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:419:13)
如果有人知道如何解决这个问题,我将非常感激。
答案 0 :(得分:2)
好的,这就是我在MacOS 10.10(优胜美地)上所做的工作,它与其他人有点不同。请注意,我不使用sudo
,而是使用方法John Papa recommends。
它最终会询问有关我的机器上的依赖关系的一些问题,但我并不总是看到它们,因此生成器似乎挂起。
答案 1 :(得分:1)
此处描述了问题(并提供了解决方案):https://github.com/wangshijun/generator-angular-cordova/issues/2
答案 2 :(得分:1)
我得到了并修好了。
我刚刚安装了发电机(本地而非全局)
C:\PhoneGap\Workspace\Demos\cordovayeoman>npm install generator-angular-cordova
成功安装包后。我跑的时候:" yo angular-cordova "我得到了同样的例外(见快照)
然后我在"文件夹"内创建了另一个文件夹( MyCordovaApp )。我在哪里安装/配置了生成器插件,即
From: C:\PhoneGap\Workspace\Demos\cordovayeoman\
To: C:\PhoneGap\Workspace\Demos\cordovayeoman\MyCordovaApp
现在我又跑了一次:" yo angular-cordova "它运作良好:)(见快照)
注意: - 我选择了iOS平台,这就是为什么它在Windows机器上为iOS生成内容时给予我的优惠。
这是生成的东西。