Issue
I had a problem with "npm start" command. which is not running angular. instead, it will be giving an error.
when a run a project using "ng serve" command then it is working fine. below attached the screenshot of the error.
I have tried several ways to fix this issue unfortunately it’s not workout.
This is my package.json file
{
"name": "myapplication",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "~11.0.6",
"@angular/common": "~11.0.6",
"@angular/compiler": "~11.0.6",
"@angular/core": "~11.0.6",
"@angular/forms": "~11.0.6",
"@angular/platform-browser": "~11.0.6",
"@angular/platform-browser-dynamic": "~11.0.6",
"@angular/router": "~11.0.6",
"rxjs": "~6.6.0",
"tslib": "^2.0.0",
"zone.js": "~0.10.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1100.6",
"@angular/cli": "~11.0.6",
"@angular/compiler-cli": "~11.0.6",
"@types/jasmine": "~3.6.0",
"@types/node": "^12.11.1",
"codelyzer": "^6.0.0",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~5.1.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.0.3",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "~4.0.2"
}
}
Solution
After a long time of spending on the issue finally found the solution. so what I did uninstall "NodeJs" completely. deleted "NPM" & "NPM-Cache" from
C:\Users\username\AppData\Roaming
and restart the PC. and again install everything freshly.
if you still exsit the same issue, then the problem is because of the folder name. in this case angular project initial under "Research & Development" folder
C:\Users\Asus\Documents\Research & Development\Video conference
project\myapplication
Finally i have removed special character "&" symbol and keep folder name as "Research-Development"
after run "npm start" command. it’s perfectly working.