[英]npm is failing to parse package.json
I'm new to using npm and node I created a react app with truffle unbox react which uses npm init react-app.我是使用 npm 和节点的新手,我使用 truffle unbox react 创建了一个反应应用程序,它使用 npm init react-app。 I have tried reinstalling npm and clearing the cache but I keep getting the following error when I run sudo npm start.
我尝试重新安装 npm 并清除缓存,但是当我运行 sudo npm start 时,我不断收到以下错误。
npm ERR! code EJSONPARSE
npm ERR! file /home/a/Documents/so/client/package.json
npm ERR! JSON.parse Failed to parse json
npm ERR! JSON.parse Unexpected token { in JSON at position 634 while parsing near '...rsion"
npm ERR! JSON.parse ]
npm ERR! JSON.parse }
npm ERR! JSON.parse }
npm ERR! JSON.parse
npm ERR! JSON.parse {
npm ERR! JSON.parse "name": "mapboxAnd...'
npm ERR! JSON.parse Failed to parse package.json data.
npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/a/.npm/_logs/2020-06-21T17_39_45_819Z-debug.log
My package.json looks like this.我的 package.json 看起来像这样。
{
"name": "client",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "16.11.0",
"react-dom": "16.11.0",
"react-scripts": "3.2.0",
"web3": "1.2.2"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
As far as I can tell package.json is nothing but json.据我所知,package.json 只不过是 json。 Please help me understand this error.
请帮助我理解这个错误。 Thankyou.
谢谢你。
Your package.json is a valid JSON file, the error is somewhere else.您的 package.json 是有效的 JSON 文件,错误在其他地方。 Can you please do the below:
你能做到以下几点:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.