我在使用 npm 时遇到了同样的问题。在我的电脑上尝试尝试避免目录问题并在 cloud9 上遇到相同的问题。希望它在虚拟机上,我可以做点什么来搞砸它,我尝试过 private:true 和 falsi 并且完全没有它。以及sockt.io“最新”与express相同。任何见解都会很棒
{ "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"
}
关于node.js - npm 安装失败。云9IDE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38365501/