0
votes

When I try to start my angular 2 project in cmd.exe with the command: npm start I have this error message:

npm ERR! Windows_NT 10.0.15063

npm ERR! argv "D:\NodeJs\node.exe" "D:\NodeJs\node_modules\npm\bin\npm-cli.js" "start"

npm ERR! node v6.11.2

npm ERR! npm v3.10.10

npm ERR! code ELIFECYCLE

npm ERR! [email protected] prestart: npm run build

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the [email protected] prestart script 'npm run build'.

npm ERR! Make sure you have the latest version of node.js and npm installed.

npm ERR! If you do, this is most likely a problem with the angular-quickstart package,

npm ERR! not with npm itself.

npm ERR! Tell the author that this fails on your system:

npm ERR! npm run build

npm ERR! You can get information on how to open an issue for this project with:

npm ERR! npm bugs angular-quickstart

npm ERR! Or if that isn't available, you can get their info via:

npm ERR! npm owner ls angular-quickstart

npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:

npm ERR! D:\Angular 2\bon\npm-debug.log"

And my package.json : " "

name": "angular-quickstart",
  "version": "1.0.0",
  "description": "QuickStart package.json from the documentation, supplemented with testing support",
  "scripts": {
    "build": "tsc -p src/",
    "build:watch": "tsc -p src/ -w",
    "build:e2e": "tsc -p e2e/",
    "serve": "lite-server -c=bs-config.json",
    "serve:e2e": "lite-server -c=bs-config.e2e.json",
    "prestart": "npm run build",
    "start": "concurrently \"npm run build:watch\" \"npm run serve\"",
    "pree2e": "npm run build:e2e",
    "e2e": "concurrently \"npm run serve:e2e\" \"npm run protractor\" --kill-others --success first",
    "preprotractor": "webdriver-manager update",
    "protractor": "protractor protractor.config.js",
    "pretest": "npm run build",
    "test": "concurrently \"npm run build:watch\" \"karma start karma.conf.js\"",
    "pretest:once": "npm run build",
    "test:once": "karma start karma.conf.js --single-run",
    "lint": "tslint ./src/**/*.ts -t verbose"
  },
  "keywords": [],
  "author": "",
  "license": "MIT",
  "dependencies": {
    "@angular/common": "~4.3.4",
    "@angular/compiler": "~4.3.4",
    "@angular/core": "~4.3.4",
    "@angular/forms": "~4.3.4",
    "@angular/http": "~4.3.4",
    "@angular/platform-browser": "~4.3.4",
    "@angular/platform-browser-dynamic": "~4.3.4",
    "@angular/router": "~4.3.4",

    "angular-in-memory-web-api": "~0.3.0",
    "systemjs": "0.19.40",
    "core-js": "^2.4.1",
    "rxjs": "5.0.1",
    "zone.js": "^0.8.4"
  },
  "devDependencies": {
    "concurrently": "^3.2.0",
    "lite-server": "^2.2.2",
    "typescript": "~2.1.0",

    "canonical-path": "0.0.2",
    "tslint": "^3.15.1",
    "lodash": "^4.16.4",
    "jasmine-core": "~2.4.1",
    "karma": "^1.3.0",
    "karma-chrome-launcher": "^2.0.0",
    "karma-cli": "^1.0.1",
    "karma-jasmine": "^1.0.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~4.0.14",
    "rimraf": "^2.5.4",

    "@types/node": "^6.0.46",
    "@types/jasmine": "2.5.36"
  },
  "repository": {}
}
"

I don't know what is the problem...

1
What happens if you run "npm run build"? - Markus Kollers
Your script ended up in an unexpected way, most probably because of the start script. Try changing it until it works correctly. Since your Node and NPM versions are up to date, this is the only possible issue - Alex Beugnet
Alex Beugnet what can I put for the start script? - Warhammer2345

1 Answers

-1
votes

Check your start script in package.json

"scripts": { "start": "ng serve" }

Or run directly using ng serve --o