简体   繁体   English

找不到Yeoman角特征生成器cdnify任务

[英]Yeoman angular-feature generator cdnify task not found

I've been looking for some automatic way to generate an angular app. 我一直在寻找一种自动的方法来生成角度应用程序。 I tried to use the angular generator on YEOMAN, but I didn't like the app structure provided. 我尝试在YEOMAN上使用角度生成器,但我不喜欢提供的应用程序结构。

I found out this other generator angular-feature ( https://github.com/codigo-pl/generator-angular-feature ) which seems to solve my problem. 我发现了另一个生成器angular-featurehttps://github.com/codigo-pl/generator-angular-feature ),它似乎可以解决我的问题。 But so far I could not make it works. 但是到目前为止,我无法使它起作用。 Every time when I try to generate the app(on feature structure) returns me an error: 每当我尝试生成(在功能结构上)应用时,都会向我返回错误:

command: grunt build (even if I try grunt server returns me the same) 命令: grunt构建 (即使我尝试使用grunt服务器也会返回相同的结果)

C:\\Users\\xxxxxx\\WorkFolders\\temp\\testGenerator>grunt build Loading "cdnify.js" tasks...ERROR C:\\ Users \\ xxxxxx \\ WorkFolders \\ temp \\ testGenerator> grunt构建正在加载“ cdnify.js”任务...错误

Error: Unable to parse C:\\Users\\xxxxxx\\WorkFolders\\temp\\testGenerator .bowerrc: Unexpected token v Warning: Task "cdnify" not found. 错误:无法解析C:\\ Users \\ xxxxxx \\ WorkFolders \\ temp \\ testGenerator .bowerrc:意外令牌v警告:找不到任务“ cdnify”。 Use --force to continue. 使用--force继续。

Aborted due to warnings. 由于警告而中止。

UPDATE: 更新:

Inside the file .bowerrc: 在文件.bowerrc中:

{
    "directory": "app\vendor/bower_components"
}

My folder after running generator: 运行发电机后我的文件夹:

testGenerator
--app
----src
------common
--node_modules

There's no bower_components folder in any place in my APP folder. 我的APP文件夹中的任何地方都没有bower_components文件夹。

Has anyone already used this YEOMAN generator and had the same problem? 有没有人使用过这个YEOMAN发生器并且有同样的问题? Is there another YEOMAN generator structured by feature like this one? 是否有另一台由这种功能构成的YEOMAN生成器?

Try this command in your project to fix the issue. 在您的项目中尝试使用此命令来解决此问题。

npm install --save-dev grunt-google-cdn

I am really not sure why this isn't documented officially anywhere nor why the default Yeoman project generation script builds with errors. 我真的不确定为什么在任何地方都没有正式记录下来,也不确定为什么默认的Yeoman项目生成脚本会生成错误。 I had to execute searches to find out about this command. 我必须执行搜索才能找到有关此命令的信息。

Also, make sure you are using a stable version of Node/npm. 另外,请确保您使用的是稳定版本的Node / npm。 One of my problems was that I was using the latest version of npm, which is 0.11.12. 我的问题之一是我使用的是最新版本的npm,即0.11.12。 However, according to Node.js's website, that version is unstable. 但是,根据Node.js的网站,该版本不稳定。 Instead, I had to use version 0.10.26, their latest stable version. 相反,我必须使用其最新的稳定版本0.10.26。

Links: 链接:

the problem was sorted out and it was facing me all the time. 这个问题已经解决,并且一直在面对我。

Problem 问题

{
    "directory": "app\vendor/bower_components"
}

Solution

{
    "directory": "app/vendor/bower_components"
}

The generator is generating backslash instead slash. 生成器生成反斜杠而不是斜杠。 But the strange thing it seems be happening only on windows. 但是奇怪的是,它似乎只发生在Windows上。 Ubuntu and Mavericks I don't have this problem. Ubuntu和Mavericks我没有这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM