【发布时间】:2013-11-24 12:23:26
【问题描述】:
在 Vagrant Shell 配置期间,我尝试在 Debian Wheezy 上安装 NodeJS 和 NPM。 脚本是(来自指南https://github.com/joyent/node/wiki/backports.debian.org):
sudo echo "deb http://ftp.us.debian.org/debian wheezy-backports main" >> /etc/apt/sources.list
sudo apt-get update
sudo apt-get install -y nodejs-legacy
curl https://npmjs.org/install.sh | sudo sh
Node 设置为魅力,但 NPM 安装失败:
来自命令的Stderr:
stdin: is not a tty
dpkg-preconfigure: unable to re-open stdin: No such file or directory
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 7810 100 7810 0 0 1407 0 0:00:05 0:00:05 --:--:-- 18956
fetching: http://registry.npmjs.org/npm/-/npm-1.3.15.tgz
npm-install-2877.sh: 270: npm-install-2877.sh: cannot open /dev/tty: No such device or address
Aborted 0.x cleanup. Exiting.
It failed
我已经用谷歌搜索了大约两天 - 找不到任何解决方案:(
UPD
如果要像这样设置 Vagrant 配置:
config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'"
然后脚本没有说任何关于 tty 的内容,但仍然失败:
Stderr from the command:
dpkg-preconfigure: unable to re-open stdin: No such file or directory
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 7810 100 7810 0 0 1412 0 0:00:05 0:00:05 --:--:-- 19772
fetching: http://registry.npmjs.org/npm/-/npm-1.3.15.tgz
npm-install-3013.sh: 270: npm-install-3013.sh: cannot open /dev/tty: No such device or address
Aborted 0.x cleanup. Exiting.
It failed
【问题讨论】:
标签: node.js npm vagrant provisioning