[英]cant install express and socket.io for nodejs
PACKAGE.JSON文件
{
"name" : "realtimewebchat",
"version" : "0.0.1",
"private" : "true",
"dependencies" : {
"socket.io" : "0.9.16",
"express" : "3.4.6"
},
"author" : "legit",
}
調試信息
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install' ]
2 info using npm@1.3.14
3 info using node@v0.10.22
4 verbose node symlink C:\Program Files\nodejs\\node.exe
5 error install Couldn't read dependencies
6 error Failed to parse json
6 error Unexpected token }
7 error File: C:\Users\Gerrerth\Desktop\chat\package.json
8 error Failed to parse package.json data.
8 error package.json must be actual JSON, not just JavaScript.
8 error
8 error This is not a bug in npm.
8 error Tell the package author to fix their package.json file. JSON.parse
9 error System Windows_NT 6.2.9200
10 error command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
11 error cwd C:\Users\Gerrerth\Desktop\chat
12 error node -v v0.10.22
13 error npm -v 1.3.14
14 error file C:\Users\Gerrerth\Desktop\chat\package.json
15 error code EJSONPARSE
16 verbose exit [ 1, true ]
我已經從stackoverflow搜索了數小時的解決方案,但仍然沒有找到合適的解決方案。 有人可以推薦一些技巧嗎?
只需刪除最后一行的結尾逗號:
{
"name" : "realtimewebchat",
"version" : "0.0.1",
"private" : "true",
"dependencies" : {
"socket.io" : "0.9.16",
"express" : "3.4.6"
},
"author" : "legit"
}
編輯:您可以使用此網站來檢查文件的JSON語法。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.