我尝试从yeoman安装webapp生成器,但是我遇到了这个错误:
在您似乎没有安装名称为webapp的生成器。
yo webapp
之后:
npm install -g yo (works fine)
npm install -g generator-webapp (works fine)
yo webapp (does not work)
这是命令行(在Mac Os上):
MBP-de-Empon:yo Empon$ npm install -g yo
npm WARN deprecated npmconf@2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm
/Users/Empon/npm/bin/yo-complete -> /Users/Empon/npm/lib/node_modules/yo/lib/completion/index.js
/Users/Empon/npm/bin/yo -> /Users/Empon/npm/lib/node_modules/yo/lib/cli.js
> yo@1.8.5 postinstall /Users/Empon/npm/lib/node_modules/yo
> yodoctor
Yeoman Doctor
Running sanity checks on your system
✔ Global configuration file is valid
✔ NODE_PATH matches the npm root
✔ Node.js version
✔ No .bowerrc file in home directory
✔ No .yo-rc.json file in home directory
✔ npm version
Everything looks all right!
/Users/Empon/npm/lib
└── yo@1.8.5
MBP-de-Empon:yo Empon$ npm install -g generator-webapp
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
/Users/Empon/npm/lib
└── generator-webapp@2.4.1
MBP-de-Empon:yo Empon$ yo webapp
Error webapp
You don't seem to have a generator with the name webapp installed.
You can see available generators with npm search yeoman-generator and then install them with npm install [name].
To see the 14 registered generators run yo with the `--help` option.
MBP-de-Empon:yo Empon$
编辑:
所以,yeoman在usr/local...
搜索,并在/Users/Empon/...
所以我将内容复制到一个名称相同的新文件夹中:generator-webapp
:
mkdir generator-webapp
cp -a /Users/Empon/npm/lib/node_modules/generator-webapp/. /usr/local/lib/node_modules/generator-webapp/
我再次尝试yo webapp
,现在我遇到了这个错误:
所以直到这一行看起来很好:
events.js:141
throw er; // Unhandled 'error' event
并在终端上显示一个新行,我无法完成sass选项:
MBP-de-Empon:yo Empon$ yo webapp
_-----_ ╭──────────────────────────╮
| | │ 'Allo 'allo! Out of the │
|--(o)--| │ box I include HTML5 │
`---------´ │ Boilerplate, jQuery, and │
( _´U`_ ) │ a gulpfile to build your │
/___A___\ /│ app. │
| ~ | ╰──────────────────────────╯
__'.___.'__
´ ` |° ´ Y `
? Which additional features would you like to include? (Press <space> to select)
❯◉ Sass
◉ Bootstrap
◉ Modernizr
events.js:141
throw er; // Unhandled 'error' event
^
TypeError: this.env.adapter.prompt(...).then is not a function
at Base.prompt (/usr/local/lib/node_modules/generator-webapp/node_modules/yeoman-generator/lib/base.js:240:45)
at module.exports.generators.Base.extend.prompting (/usr/local/lib/node_modules/generator-webapp/app/index.js:102:17)
at Object.<anonymous> (/usr/local/lib/node_modules/generator-webapp/node_modules/yeoman-generator/lib/base.js:439:23)
at /usr/local/lib/node_modules/generator-webapp/node_modules/yeoman-generator/node_modules/run-async/index.js:25:25
at /usr/local/lib/node_modules/generator-webapp/node_modules/yeoman-generator/node_modules/run-async/index.js:24:19
at /usr/local/lib/node_modules/generator-webapp/node_modules/yeoman-generator/lib/base.js:440:9
at processImmediate [as _immediateCallback] (timers.js:383:17)
MBP-de-Empon:yo Empon$