npm安装失败。 云9 ide

我与npm有同样的问题。 尝试在我的电脑上试图避免目录问题,并获得cloud9相同的问题。 希望能够在虚拟机器上运行,我可以把它搞砸,我尝试了私有的:真正的和真正的,完全没有它。 以及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 

你在这里错过了一个冒号:

 { "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" }