问题描述
我运行了 sudo npm install -g generator-flask
并且它被保存了.我可以通过运行 npm list-g
来确认.
然后我运行 yo flask
.我以为这会奏效,反而收到一条错误消息:
我按照它告诉我的方式运行 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 无法识别全局安装的生成器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!