Reputation: 267
I have cloned the my old project and run npm install
and after that i run ionic serve
And i found this error
[ERROR] @ionic/app-scripts is required for ionic serve to work properly.
Looks like @ionic/app-scripts isn't installed in this project.
This package is required for ionic serve in ionic/angular 4 projects.
Upvotes: 9
Views: 29108
Reputation: 1
After some research I found out that it was a permission problem.
In my case I solved it in a different way. I had to change permission and then update
sudo chown -R thiagodias:thiagodias /Documents/ionic_workspace
:~/Documents/ionic_workspace/test$ sudo npm install @ionic/app-scripts@latest
Upvotes: 0
Reputation: 581
Try installing by running the following command:
npm i -D -E @ionic/app-scripts
Upvotes: 0
Reputation: 15
In package.json
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
}
delete '"ionic:serve": "ionic-app-scripts serve"
',
save it and execute ionic serve
.
It should work now.
After that, you can add "ionic:serve": "ionic-app-scripts serve"
back.
Upvotes: 0
Reputation: 44285
This happened to me when I upgraded from Ionic 3 to 4. The problem is that package.json
and ionic.config.json
both changed from 3 to 4. So when you do your copy-paste actions you have to be careful.
angular
(used to be "type": "ionic-angular"){
"name": "myProjectName",
"integrations": {
"cordova": {}
},
"type": "angular"
}
You may have had something like this
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint --bailOnLintError true",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve",
"ionic:watch:before": "node ./bin/pre-build.js",
"ionic:build:before": "node ./bin/pre-build.js"
},
That should now changed to standard angular in Ionic 4:
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
Upvotes: 0
Reputation: 2953
To solve the above issue following below commands :
Upvotes: 18
Reputation: 41
I ran into this after updating to Ionic 4. I ended up having to downgrade.
https://github.com/ionic-team/ionic-cli/issues/3399
Upvotes: 4
Reputation: 65
In addition to deleting node_modules and running npm install
as mentioned by @tnfaid, I also deleted package-lock.json
file just to be sure. Also ran npm audit fix
, to resolve any vulnerabilities. This worked for me.
Upvotes: 0
Reputation: 71
delete your node_modules folder
Run:
npm install
wait until it finishes. Now you could run your project with:
ionic serve -l
Upvotes: 3
Reputation: 2305
Your question's title itself has the answer.
Try to install the following
npm install @ionic/app-scripts@latest --save-dev
Upvotes: 12