[英]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.