Yeoman 无法识别全局安装的生成器 [英] Yeoman can't recognize a generator that was installed globally

查看:56
本文介绍了Yeoman 无法识别全局安装的生成器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我运行了 sudo npm install -g generator-flask 并且它被保存了.我可以通过运行 npm list-g 来确认.

然后我运行 yo flask.我以为这会奏效,反而收到一条错误消息:

<前>错误烧瓶您似乎没有安装名称为flask 的生成器.您可以使用 npm search yeoman-generator 查看可用的生成器,然后使用 npm install [name] 安装它们.要查看 22 个已注册的生成器,请使用 `--help` 选项运行.

我按照它告诉我的方式运行 yo --help 并发现烧瓶生成器不在那里.

我用 sudo npm install -g generator-angular-flask 试试这个,问题是用 Angular Flask 重现的.我假设所有生成器都会发生这种情况,这就是为什么我将其命名为 Yeoman 无法识别新的 npm 安装.

有人知道为什么会这样吗?

解决方案

一种解决方法,但确实解决了问题:

npm 链接生成器-angular-flask

(就像在本地安装模块一样)

I ran sudo npm install -g generator-flask and it was saved. I was able to confirm by running npm list-g.

I then run yo flask. Thinking that this was going to work, I instead get an error message:

Error flask

You don't seem to have a generator with the name flask installed.
You can see available generators with npm search yeoman-generator and then install them with npm install [name].
To see the 22 registered generators run yo with the `--help` option.

I do as it tells me by running yo --help and discover that the flask generator is not there.

I try this with sudo npm install -g generator-angular-flask and the problem is recreated with Angular Flask. I'm assuming this is going to happen for all the generators which is why I've titled it as Yeoman not recognizing new npm installs.

Does anyone know why this has happened?

解决方案

A workaround, but does solve the problem:

npm link generator-angular-flask

(as does just installing the module locally)

这篇关于Yeoman 无法识别全局安装的生成器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆