【发布时间】:2021-04-05 12:36:38
【问题描述】:
我正在看一个运行 node.js 服务器的教程,我做了与他完全相同的事情,但它不起作用。
这是 package.json:
{
"name": "myserver",
"version": "1.0.0",
"description": "form",
"main": "index.js",
"scripts":{
"start":"node index.js",
"myserver":"nodemon index.js",
"newtailor":"npm start --prefix newtailor",
"dev":"concurrently \"npm run myserver\" \"npm run newtailor\""},
"author": "wes",
"license": "ISC",
"dependencies":
{"body-parser": "^1.19.0",
"concurrently": "^5.3.0",
"cors": "^2.8.5",
"express": "^4.17.1",
"nodemailer": "^6.4.17",
"nodemon": "^2.0.6"}
}
出现此错误。
npm ERR! JSON.parse "newtailor":"npm...'
npm ERR! JSON. parse Failed to parse package.json data.
npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.
【问题讨论】:
-
你运行了什么命令?
-
我拿了这个
package.json,它工作正常 -
npm run dev 和 npm start