node.js - 预计第 32 行第 1 列远程的另一个键值对:!无法解析 package.json
问题描述
我试图将 MERN 堆栈应用程序部署到 heroku,但这样做时遇到了一些问题。当我尝试部署它时,它会给我这个错误,说Expected another key value pair at line 32 column 1
有人可以解释这意味着什么以及我该如何解决它?谢谢 !!
{
"name": "axios-react",
"version": "0.1.0",
"private": true,
"dependencies": {
"axios": "^0.18.0",
"cors": "^2.8.4",
"google-map-react": "^1.0.4",
"google-maps-react": "^2.0.2",
"node": "^10.12.0",
"react": "^16.3.2",
"react-dom": "^16.3.2",
"react-geolocated": "^2.4.0",
"react-geolocation": "^1.0.3",
"react-google-maps": "^9.4.5",
"react-places-autocomplete": "^7.1.2",
"react-router": "^4.3.1",
"react-router-dom": "^4.3.1",
"react-scripts": "^1.1.4",
"react-star-rating": "^1.4.2"
},
"scripts": {
"start": "react-scripts start",
"start-js": "react-scripts",
"build": "react-scripts build",
"predeploy": "npm run build",
"deploy": "gh-pages -d build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"proxy": "http://localhost:5000/",
}
解决方案
删除“代理”行末尾的最后一个逗号。像这样:
{
"name": "axios-react",
"version": "0.1.0",
"private": true,
"dependencies": {
"axios": "^0.18.0",
"cors": "^2.8.4",
"google-map-react": "^1.0.4",
"google-maps-react": "^2.0.2",
"node": "^10.12.0",
"react": "^16.3.2",
"react-dom": "^16.3.2",
"react-geolocated": "^2.4.0",
"react-geolocation": "^1.0.3",
"react-google-maps": "^9.4.5",
"react-places-autocomplete": "^7.1.2",
"react-router": "^4.3.1",
"react-router-dom": "^4.3.1",
"react-scripts": "^1.1.4",
"react-star-rating": "^1.4.2"
},
"scripts": {
"start": "react-scripts start",
"start-js": "react-scripts",
"build": "react-scripts build",
"predeploy": "npm run build",
"deploy": "gh-pages -d build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"proxy": "http://localhost:5000/"
}
每当您在 json 中指定逗号时,它都需要一个键值对,这解释了错误
推荐阅读
- java - Maven 不解析父 POM 文件
- python - 无法导入 RollingOLS:ModuleNotFoundError:没有名为“statsmodels.regression.rolling”的模块
- javascript - 我正在使用 react-admin 依赖项,但编辑不起作用
- python - 判断一个句子是积极的、中性的还是消极的?
- python - Python:类型错误'float'对象不可迭代
- powershell - 如何使用拆分和子字符串以及 foreach 处理数组
- flutter - 如何在颤动中为 DraggableScrollableSheet 提供精确的高度值?
- python - 为什么keras会跳过保存检查点?
- javascript - 如何使用 JavaScript 进行表单验证?
- sharepoint - 用于上传文件并复制到 Ms 团队的 Sharepoint API