1

我已经从官方网站下载了 Bootstrap 3.1.1 源文件,当按照网站上的引导设置说明尝试npm installbootstrap/目录中运行时出现错误。

我在npm 1.3.10从分发存储库安装的 Ubuntu 14.04 平台上,并且可以成功运行npm install -g grunt-cli而没有问题。

但是,当我尝试sudo npm install从引导目录中进行操作时,我看到一长串成功的 GET 消息,然后终止并出现以下错误:

npm http 304 https://registry.npmjs.org/proto-list

> phantomjs@1.9.7-4 install /home/cboettig/Documents/code/thirdparty/bootstrap/node_modules/grunt-contrib-qunit/node_modules/grunt-lib-phantomjs/node_modules/phantomjs
> node install.js

npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! weird error 1
npm ERR! not ok code 0

我已经查阅了README.Debian警告中提到的内容,这似乎只是说 Debian 平台需要调用nodejs而不是node避免命名空间冲突。我不确定如何验证这是否有问题。

我发现错误消息weird error 1也不是特别有用。

如何干净地安装这个项目而不会出错?

4

2 回答 2

2

运行这些命令

sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install python-software-properties python g++ make nodejs

从存储库安装 node.js。

于 2014-04-23T17:45:01.490 回答
-1

安装nodejs-legacy,这修复了错误

于 2017-05-26T17:44:54.280 回答