无法在节点js中安装依赖关系
即时学习节点js和我只是做了一个教程,我试图创build一个聊天,一切都很好,直到我被困在教程的一个步骤。 我决定下载的教程来源运行serven,看看有什么问题我有一个文件夹名为curso在这个文件夹中我有两个文件夹聊天nodenodejs和其他是sourcechatjs聊天nodejs我有packasge.json和服务器js ,我跑了npminstall,一切都很好。 但是,当我downloades聊天源,我把它放在sourcechatjs我打开了temirnal,并运行npm安装,并得到了这个错误。
jhonnatans-MacBook-Pro:chat jhonnatan$ npm install npm ERR! install Couldn't read dependencies npm ERR! Failed to parse json npm ERR! Unexpected token / npm ERR! File: /Users/jhonnatan/Documents/Cursoseccion2/clasenodejs/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! System Darwin 12.3.0 npm ERR! command "node" "/usr/local/bin/npm" "install" npm ERR! cwd /Users/jhonnatan/Documents/Cursoseccion2/clasenodejs/chat npm ERR! node -v v0.10.0 npm ERR! npm -v 1.2.14 npm ERR! file /Users/jhonnatan/Documents/Cursoseccion2/clasenodejs/chat/package.json npm ERR! code EJSONPARSE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /Users/jhonnatan/Documents/Cursoseccion2/clasenodejs/chat/npm-debug.log npm ERR! not ok code 0
这是我的json的样子
{ // Aca definiremos nuestro package.json, lo primero es el nombre "name": "curso", // Luego la version del mismo "version": "0.0.1", // Ahora las dependencias, normalmente podrias hacer esto con npm pero es mucho mejor tener claro y ejecutar estricatemente las necesaria "dependencies": { // Express el cual se encargara de ser nuestro framework en node "express": "", //los tipos de vista, jade parecido al que usa ruby on rails y swig parecido al que usa django "jade": "", "swig": "", // El que se encargara de renderizar los templates en un contexto "consolidate": "", // y por ultimo el encargado de manejar los sockets :) "socket.io": "" }
}
四,一直在尝试了很多,但认真我不知道可能是什么问题,我会欣赏有人可以让我知道这个问题!
您不能在JSON文件中留言。
删除注释行// ...
,它应该工作。