npm install sails尝试在版本1.7.5安装较少

时间:2015-04-09 15:28:25

标签: ubuntu less npm sails.js

我在Ubuntu上安装帆; 节点-v 0.12.2 和npm -v 2.7.4。

npm install sails错误;

sails@0.11.0 preinstall /home/ubuntu/sails/node_modules/sails
node ./lib/preinstall_npmcheck.js

Sails.js Installation: Checking npm-version successful
npm WARN deprecated node-switchback@0.0.4: The 'node-switchback' NPM module is now simply 'switchback'. See https://github.com/node-machine/switchback for latest docs.
npm WARN deprecated grunt-lib-contrib@0.7.1: DEPRECATED. See readme:https://github.com/gruntjs/grunt-lib-contrib
npm WARN deprecated node-switchback@0.0.2: The 'node-switchback' NPM module is now simply 'switchback'. See https://github.com/node-machine/switchback for latest docs.
npm WARN optional dep failed, continuing uglify-js@2.3.6
npm ERR! Linux 3.16.0-5-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "sails"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4
npm ERR! file /home/ubuntu/.npm/less/1.7.5/package/package.json
npm ERR! code EJSONPARSE

npm ERR! Failed to parse json
npm ERR! No data, empty input at 1:1
npm ERR! 
npm ERR! ^
npm ERR! File: /home/ubuntu/.npm/less/1.7.5/package/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/sails/npm-debug.log

似乎指向的是1.7.5以下的旧版本。我能够npm install less 2.5

我在Sails' github repo上打开了一个问题。在那里发展的其他细节。

2 个答案:

答案 0 :(得分:1)

错误code EJSONPARSEpackage.json的问题。安装节点包时,它会将package.json文件存储在.npm文件夹中。您的.npm文件夹中下载的1.7.5软件包文件似乎已损坏。

运行以下命令:

sudo rm -rf /home/ubuntu/.npm/less/1.7.5/

这会删除计算机上的本地较少package.json文件,以便从NPM服务器中取出。现在您可以尝试再次安装Sails。

答案 1 :(得分:0)

错误消息将包含以下消息 -

npm ERR!无法解析json

npm ERR!没有数据,1:1的空输入

npm ERR!

npm ERR! ^

npm ERR!文件:/ home / user / path_to_corrupted_file

使用此路径删除损坏的文件并再次运行npm install。