Angular CLI 不会创建新项目 [英] Angular CLI wont create new project
问题描述
我正在尝试通过 angular cli 创建一个项目(名为 ngadmin),但它在此命令上引发错误:ng new ngadmin
.错误是:
I am trying to create a project (named ngadmin) via the angular cli but it throws errors on this command: ng new ngadmin
. The errors are:
fs:不支持重新评估本机模块源.如果你是使用 graceful-fs 模块,请将其更新为更新的版本.
fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
您不能在 angular-cli 项目中使用新命令.
You cannot use the new command inside an angular-cli project.
我不确定是什么问题,因为几天前这个 cli 对我来说工作正常.
I am not sure what the problem is as this cli was working fine for me a few days ago.
推荐答案
检查你的 username 文件夹,如果有 package.json
和 node_module
存在.如果它们在那里,则删除它们.
Check in your username folder, if there is package.json
and node_module
exist. If they are there then delete them.
注意:您可能已经在 home/username
目录中创建了一个 angular 项目.如果您删除它们,它将起作用.
Notice: you may have created an angular project in your home/username
directory. If you delete them it will work.
这篇关于Angular CLI 不会创建新项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!