我是 yeoman 工具集的新手。我在 Ubuntu 12 中运行以下命令
$ npm install -g yo
$ npm install -g generator-webapp
$ yo webapp
我能够创建一个 Web 应用程序项目。之后我尝试创建一个角度项目。首先我运行一个命令
$ npm install -g generator-angular
安装此生成器时不会显示任何错误。
当我运行命令时
$ yo angular
我得到错误:
Error angular
You don't seem to have a generator with the name angular installed.
You can see available generators with npm search yeoman-generator and then install them with npm install [name].
To see the 2 registered generators run yo with the `--help` option.
如何解决这个问题?当我运行命令时
$ ls $(npm config get prefix)/lib/node_modules
输出是:
bower generator-angular generator-karma generator-mocha generator-webapp grunt-cli yo
当我使用安装生成器主干时发生了同样的问题
$ npm install -g generator-backbone
它成功安装了软件包,当我在空文件夹中运行命令时
$ yo backbone
它给出了输出
Error backbone
You don't seem to have a generator with the name backbone installed.
You can see available generators with npm search yeoman-generator and then install them with npm install [name].
To see the 2 registered generators run yo with the `--help` option.
当我运行命令时
$ npm config get prefix
它给了我输出
/home/ritesh/npm
也许我在这条路上犯了一些错误。任何人都可以告诉如何解决它?