我和npm有同样的问题。试图在我的电脑上尝试避免目录问题并在cloud9上遇到相同的问题。希望它在虚拟机上,我可以做的很少搞乱它,我尝试私有:真实和falsi,完全没有它。以及sockt.io"最新"与快递相同。任何见解都会很棒
{ "name": "chit",
"version": "0.0.1",
"description": "chat practice",
"private": "false",
"dependencies":{ "socket.io":"1.4.8",
"express":"4.14.0" }
"author": "Charles",
"license": "ISC"
非常感谢
见错误
ERR! install Couldn't read dependencies
npm ERR! Linux 4.2.0-c9
npm ERR! argv "/home/ubuntu/.nvm/versions/node/v4.4.5/bin/node" "/home/ubuntu/.nvm/versions/node/v4.4.5/bin/npm" "install"
npm ERR! node v4.4.5
npm ERR! npm v2.15.5
npm ERR! file /home/ubuntu/workspace/chat/package.json
npm ERR! code EJSONPARSE
npm ERR! Failed to parse json
npm ERR! Unexpected token 'a' at 10:4
npm ERR! "author": "Charles",
npm ERR! ^
npm ERR! File: /home/ubuntu/workspace/chat/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! Please include the following file with any support request:
npm ERR! /home/ubuntu/workspace/chat/npm-debug.log
答案 0 :(得分:1)
你在这里错过了一个冒号:
{ "name": "chit", "version": "0.0.1", "description": "chat practice", "private": "false", "dependencies":{ "socket.io":"1.4.8", "express":"4.14.0" } // <--- missing colon here "author": "Charles", "license": "ISC"
应该是:
{
"name": "chit",
"version": "0.0.1",
"description": "chat practice",
"private": "false",
"dependencies": {
"socket.io": "1.4.8",
"express": "4.14.0"
},
"author": "Charles",
"license": "ISC"
}