npm安装错误 - package.json无效

tld*_*ldr 10 json node.js oauth-2.0 npm express

我正在使用教程来了解在Node.js中实现oauth2.

这是我的package.json:

{
  "name": "application-name",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "coffee -w server.coffee"
  },  
  "dependencies": {
    "express": "3.3.4",
    "jade": "*",
    "coffee-script": "latest",
    "passport-http": "latest",
    "passport-http-bearer": "latest",
    "passport-oauth2-client-password": "latest",
    "oauth2orize": "latest",
    "debug" "~0.7.2"
  }
}
Run Code Online (Sandbox Code Playgroud)

我收到错误:

npm ERR! install Couldn't read dependencies
npm ERR! Failed to parse json
npm ERR! Unexpected string
npm ERR! File: /Users/jashua/Desktop/auth/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! This is not a bug in npm.
npm ERR! Tell the package author to fix their package.json file. JSON.parse

npm ERR! System Darwin 12.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Users/jashua/Desktop/auth
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! file /Users/jashua/Desktop/auth/package.json
npm ERR! code EJSONPARSE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/me/Desktop/auth/npm-debug.log
npm ERR! not ok code 0
Run Code Online (Sandbox Code Playgroud)

任何想法我的package.json有什么问题?

hex*_*ide 11

该错误意味着它所声明的内容,您的JSON package.json无效且无法正确解析.更改"debug" "~0.7.2""debug": "~0.7.2".

  • 此外,如果使用`--save` npm标志安装依赖项,则无需手动编辑`package.json` (4认同)