我用;node -v 0.12.2和npm -v 2.7.4在Ubuntu上安装了sails。
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的旧版本。我能够以2.5的速度使用npm install less
我在Sails' github repo上开了一期。其他细节正在开发中。
发布于 2015-04-14 09:33:57
错误code EJSONPARSE是package.json的问题。安装节点包时,它会将package.json文件存储在.npm文件夹中。您的.npm文件夹中似乎下载了一个损坏的1.7.5以下的软件包文件。
运行以下命令:
sudo rm -rf /home/ubuntu/.npm/less/1.7.5/这删除了您计算机上的本地less package.json文件,以便它从NPMs服务器中提取。现在,您可以再次尝试安装Sails。
发布于 2015-07-09 15:08:20
错误消息将包含以下消息-
npm错误!无法解析json
npm错误!无数据,1:1输入为空
npm错误!
npm错误!^
npm错误!文件: /home/user/path_to_corrupted_file
使用此路径删除损坏的文件,然后再次运行npm安装。
https://stackoverflow.com/questions/29542752
复制相似问题