1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > angular新建library报错The new command requires to be run outside of a project but a project definition

angular新建library报错The new command requires to be run outside of a project but a project definition

时间:2023-08-15 22:15:19

相关推荐

angular新建library报错The new command requires to be run outside of a project  but a project definition

使用angular新建项目后,在项目下新建组件库时报错:

The new command requires to be run outside of a project, but a project definition was found at “D:\Workspace\WebstormProjects\nz-supzorro\angular.json”.

The new command requires to be run outside of a project, but a project definition was found at "D:\Workspace\WebstormProjects\nz-supzorro\angular.json".

具体的命令:

ng new nz-supzorro,新建项目名为nz-supzorro的项目;

cd nz-supzorro,切换到项目目录下;

ng new library my-unit,新建组件库,报错!

解决:

首先确定自己已经进入到项目目录下了 √

其次,检查命令,

发现新建组件库的命令应该是ng g library my-unit,命令写错了!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。