首页 > 解决方案 > 使用 NPM 启动 lite-server 时出错

问题描述

npm 错误!代码 EJSONPARSE

npm 错误!文件 C:\Users\thehitmanranjan\Desktop\git-test\package.json

npm 错误!JSON.parse 解析 json 失败

npm 错误!JSON.parse 解析时 JSON 中第 240 位的意外字符串'{

npm 错误!JSON.parse "名称": "git-test",

npm 错误!JSON.parse“版本”:“1。”

npm 错误!JSON.parse 无法解析 package.json 数据。

npm 错误!JSON.parse package.json 必须是实际的 JSON,而不仅仅是 JavaScript。

这是我在发出命令“npm start”时得到的错误。我的 package.JSON 文件包含以下内容:

{

"name": "git-test",

"version": "1.0.0",

"description": "\"This is a test directory to learn Git and Node\"",

"main": "index.html",

"scripts": {

"start":"npm run lite",

"test": "echo \"Error: no test specified\" && exit 1"

"lite":"lite-server"

},

"repository": {

"type": "git",

"url": "git+https://github.com/thehitmanranjan/git-test.git"

},

"author": "Pratik Ranjan",

"license": "ISC",

"bugs": {

"url": "https://github.com/thehitmanranjan/git-test/issues"

},

"homepage": "https://github.com/thehitmanranjan/git-test#readme",

"devDependencies": {

"lite-server": "^2.5.4"

}

}

标签: node.jsjsonnpmnode-modulesangular-fullstack

解决方案


此行后面少了一个逗号"test": "echo \"Error: no test specified\" && exit 1"


推荐阅读