[英]during npm install getting Failed to parse package.json data
在Windows 10上进行npm安装期间,出现此错误,我正在使用节点v6.10.3和npm v3.10.10
请帮助纠正此问题。
我得到的错误
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文件内容:
{
"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"
}
}
您可能在行中有一个不可见的字符\\r
:
"start":"tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ",
该字符破坏了package.json
文件的json解析。 尝试用手重写文本的该部分,或使用正则表达式搜索在文本编辑器中将其删除。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.