[转载]关于window下rNode.js的本地包路径过长,导致一些功能无法使用

来源:互联网 发布:域名注册软件 编辑:程序博客网 时间:2024/05/19 17:06

下午安装Yeoman的angular-generator时候,安装完成后我创建一个angular项目,但是运行

yo angular angularProject这句命令的时候确报了一个错,错误的内容就是下面这

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 1 registered generators run yo with the `--help` option.

在node论坛问了下,都说没这个问题,后面有个哥们儿让我看下包路径,

我看了下是在C:\Users\Administrator\AppData\Roaming\npm下,他说这个路径太长了,可能会影响到,然后我就修改了抱得默认全局路径

在nodejs的安装目录中找到node_modules\npm\npmrc文件

修改如下即可:

prefix = D:\nodejs\node_global
cache = D:\nodejs\node_global

然后重新下载angular-generator,执行yo angular angularProject,解决问题。


原文出处:点击打开链接

0 0
原创粉丝点击