ubuntu - npm installsails 尝试在 1.7.5 版本安装 less

标签 ubuntu less npm sails.js

我在 Ubuntu 上安装风 sails ;
节点-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

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

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

最佳答案

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

运行以下命令:

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

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

关于ubuntu - npm installsails 尝试在 1.7.5 版本安装 less,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29542752/

相关文章:

Python:sqlite OR 语句

css - 设计 Twitter 的 Bootstrap 3.x 按钮

ruby-on-rails - 使用 less (2.2.1) 会引发需要 therubyracer 的错误(无法在 Windows 上安装 therubyracer)

css-selectors - 如何在 Less 中使用 begin with 选择器

javascript - Github 操作 - 达到堆限制分配失败

npm - 为什么 'npm doctor'会产生权限错误?

android - 没有生成 R.java,因为 eclipse 无法运行 aapt

c - Hello world 程序在 main 中出现 void 错误

linux - linux 上的 shell 脚本无法运行

reactjs - npm run android 在 Windows 10 中不工作