1

during npm install on windows 10 i am getting this error I am using node v6.10.3 and npm v3.10.10

please help to correct this.

error I am getting

npm ERR! npm v3.10.10 npm ERR! file C:\angular2-helloworld\package.json npm ERR! code EJSONPARSE npm ERR! Failed to parse json npm ERR! Unexpected token '\r' at 5:71 npm ERR! "start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\"\ npm ERR! ^ npm ERR! File: C:\angular2-helloworld\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.parsenpm ERR! node v6.10.3 

package.json file contents:

{ "name":"angular2-helloworld", "version":"1.0.0", "scripts":{ "start":"tsc && concurrently \"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.14", "systemjs":"0.19.25", "es6-shim":"^0.35.0", "reflect-metadata":"0.1.2", "rxjs":"5.0.0-beta.2", "zone.js":"0.6.6" }, "devDependencies":{ "concurrently":"^2.0.0", "lite-server":"^2.2.0", "typescript":"^1.8.9", "typings":"^0.7.12" } } 
3
  • What tsc task do? Also why in your start script you start tsc without npm run but you start tsc:w as npm run tsc:w? Commented May 12, 2017 at 19:11
  • \r means a carriage return. NPM is complaining about a carriage return at the very end of line 5. What text editor are you using to make changes to package.json? Commented May 12, 2017 at 19:12
  • I am using notepad ++ to make changes in it Commented May 13, 2017 at 4:13

1 Answer 1

1

You probably have an invisible character \r at line:

"start":"tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ", 

That character breaks the json parsing of the package.json file. Try to rewrite that part of the text by hand, or use a regex search to delete it in your text editor.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.