node.js - 使用 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"
}
}
解决方案
此行后面少了一个逗号"test": "echo \"Error: no test specified\" && exit 1"
推荐阅读
- r - data.table 列表:按变量过滤
- git - 来自另一个分支的结帐文件夹不会删除文件
- javascript - 如何修复 Android React Native AssembleRelease 中的崩溃强制关闭
- python - 如何通过图像处理仅在图像上保留垂直线?
- asp.net-mvc - 防止 MVC 中的后退按钮
- sql - Min() 和 Max() 基于 sql server 中的分区
- json - 如何获取精确器中匹配元素的数量(Json/css/xpath)
- c++ - c++20 模块(使用 Xcode 11 进行实验)
- ios - 从另一个视图控制器导航栏加载视图控制器的 UIWebView 中的请求 url
- azure-active-directory - 没有 Microsoft 登录页面的 Azure AD SSO