2015-10-27 2 views
1

Когда я выдаю «$ npm install», тогда package.json не получает синтаксический анализ.Не удалось проанализировать package.json: npm install

Я использую версию NPM v2.11.2 на ubuntu 14.04.

package.json

{ 
    "name": "sockjs-express", 
    "version": "0.0.0-unreleasable", 
    "dependencies": { 
     "express": "~3*", 
     "sockjs": "*", 
     "hiredis": "*", 
     "redis": "*" 

    } 
} 

ошибка Ниже сообщается:

:~/sfax/djangotest/sockjs_serv$ sudo npm install 
npm ERR! install Couldn't read dependencies 
npm ERR! Linux 3.13.0-48-generic 
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--production" 
npm ERR! node v0.12.5 
npm ERR! npm v2.11.2 
npm ERR! file /home/ubuntu/sfax/djangotest/sockjs_serv/package.json 
npm ERR! code EJSONPARSE 

npm ERR! Failed to parse json 
npm ERR! Unexpected token '/' at 9:10 
npm ERR!   "/home/ubuntu/sfax/djangotest/sockjs_serv/npm-debug.log", 
npm ERR!  ^
npm ERR! File: /home/ubuntu/sfax/djangotest/sockjs_serv/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/sfax/djangotest/sockjs_serv/npm-debug.log 

Невозможно получить, где я буду неправильно.

ответ

1

Version must be parseable by node-semver, which is bundled with npm as a dependency. (npm install semver to use it yourself.)

Ваш номер версии для express выглядит неправильно. Вы можете использовать * для входа в систему для одного или нескольких номеров версий; то есть; 3.0.* соответствует любой второстепенной версии версии 3. Но он не может заменить ..

Смежные вопросы