【问题标题】:Error in starting the lite-server using NPM使用 NPM 启动 lite-server 时出错
【发布时间】:2020-06-19 03:19:08
【问题描述】:

npm 错误!代码 EJSONPARSE

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

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

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

npm 错误! JSON.parse "name": "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.js json npm node-modules angular-fullstack


    【解决方案1】:

    另外,如果这不起作用,请尝试将您的 package.json 重命名为 package.json.old 并重新命名 npm init。它解决了我的问题。我疯了好几个小时想弄明白。

    【讨论】:

      【解决方案2】:

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

      【讨论】:

        猜你喜欢
        • 2020-09-24
        • 1970-01-01
        • 2017-01-29
        • 2020-07-21
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-12-02
        • 2015-08-19
        相关资源
        最近更新 更多