F.Sidahmed
F.Sidahmed

Reputation: 21

npm install error in angular2

I am a begginer in angular2 when i type npm install i got these errors:

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: [email protected]
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v6.3.0
npm ERR! npm  v3.10.3
npm ERR! file C:\Users\SIDAHMED\AppData\Roaming\npm-cache\chalk\1.1.3\package\package.json
npm ERR! code EJSONPARSE

npm ERR! Failed to parse json
npm ERR! Unexpected token '\u0000' at 1:1
npm ERR!
npm ERR! ^
npm ERR! File: C:\Users\SIDAHMED\AppData\Roaming\npm-cache\chalk\1.1.3\package\package.json
npm ERR! Failed to parse package.json data.
npm ERR! package.json must be actual JSON, not just JavaScript.
npm ERR!
npm ERR! This is not a bug in npm.
npm ERR! Tell the package author to fix their package.json file. JSON.parse

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\SIDAHMED\Documents\angular2\npm-debug.log

package.json file:

{
  "name": "ng2-test",
  "version": "1.0.0",
  "scripts": {
    "start": "concurrent \"npm run tsc:w\" \"npm run lite\" ",    
    "tsc": "tsc",
    "tsc:w": "tsc -w",
    "lite": "lite-server",
    "typings": "typings",
    "postinstall": "typings install" 
  },
  "license": "ISC",
  "dependencies": {
    "angular2": "2.0.0-beta.7",
    "systemjs": "0.19.22",
    "es6-promise": "^3.0.2",
    "es6-shim": "^0.33.3",
    "reflect-metadata": "0.1.2",
    "rxjs": "5.0.0-beta.2",
    "zone.js": "0.5.15"
  },
  "devDependencies": {
    "concurrently": "^2.0.0",
    "lite-server": "^2.1.0",
    "typescript": "^1.7.5",
    "typings":"^0.6.8"
  }
}

i tried npm install [email protected] and when i type npm start i have these error messages:

> [email protected] start C:\Users\SIDAHMED\Documents\angular2
> concurrent "npm run tsc:w" "npm run lite"

'concurrent' n’est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.

npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v6.3.0
npm ERR! npm  v3.10.3
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `concurrent "npm run tsc:w" "npm run lite" `
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'concurrent "npm run tsc:w" "npm run lite" '.
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 ng2-test package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     concurrent "npm run tsc:w" "npm run lite"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs ng2-test
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls ng2-test
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\SIDAHMED\Documents\angular2\npm-debug.log

Upvotes: 1

Views: 3247

Answers (1)

Sanket
Sanket

Reputation: 20047

Can you try following steps-

  1. Delete node_modules folder from your project.
  2. Run 'npm cache clean' command.
  3. Run 'npm install' command.

I have verified your package.json on http://jsonlint.com/ and looks valid JSON-

package.json validattion

As per your provided package.json you are using "angular2": "2.0.0-beta.7" which is very old version. Current version of Angular2 is 2.0.0-rc.4. You can find more information here -https://angular.io/guide/quickstart

See if this helps.

Upvotes: 2

Related Questions