Error - This command can only be run inside of a CLI project

↘锁芯ラ 提交于 2019-12-04 07:59:55

Ok let me, instead of commenting, write an answer.

The error occurs because you're using the Angular CLI in a project which isn't generated by the Angular CLI, thus missing configuration files.

Since you're stating that you have an ionic 3 application, you don't need the angular CLI.

Step 1: create project (you probably have done this one)

ionic start portal blank  

Step 2: go into your project

cd portal

Step 3: (npm install is already done, just generate a service)

ionic generate provider user

Your steps must be in this order:

1) Install angular globally

npm install -g angular-cli@latest

2) Create the app at a directory location

ng new portal 

3) Go into that folder

cd .\portal\

4) Install node modules

npm install

5) Generate service

ng g service user

If your commands are not in this order, you will have an error.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!