繁体   English   中英

尝试安装Express时Package.json解析错误

[英]Package.json parse error when trying to install express

嗨,我正在尝试通过npm安装express,我收到以下错误消息:

npm ERR! file C:\Projects\node\package.json
npm ERR! code EJSONPARSE
npm ERR! Failed to parse json
npm ERR! Unexpected token p in JSON at position 1 while parsing near 'npm 
install {
npm ERR!   "name...'
npm ERR! File: C:\Projects\node\package.json
npm ERR! Failed to parse package.json data.
npm ERR! package.json must be actual JSON, not just JavaScript.
npm ERR!
npm ERR! Tell the package author to fix their package.json file. JSON.parse
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\george\AppData\Roaming\npm-cache\_logs\2017-10-
13T01_40_22_074Z-debug.log

我通过json验证程序运行package.json并收到以下消息:

 Error: Parse error on line 1:
    npm install--{  "nam
    ^
    Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[', got  
    undefined'

这是package.json内部的内容:

npm install --{
  "name": "node",
  "version": "1.0.0",
  "description": "My first project",
  main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "George Meehan",
  "license": "ISC"
}

我对如何解决这个问题感到困惑。

正确的package.json是:

{
  "name": "node",
  "version": "1.0.0",
  "description": "My first project",
  main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "George Meehan",
  "license": "ISC"
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM