[英]npm protocol error after yo hubot command
我已经在这一天了约一天了。 我通过vagrant在虚拟盒子上运行ubuntu / trusty64。 每次我尝试使用yo hubot命令构建一个新的hubot项目时,都会安装hubot,但是会出现npm错误。 我真的无法弄清楚问题是什么。
我通过shell安装了node,npm,hubot和coffee脚本。 这是我的provision.sh脚本的样子
#!/bin/bash
# update package libraries
apt-get -y update
# install curl if it is not already installed
apt-get -y install curl
# if nodejs is not installed...
type node >/dev/null 2>&1 || if [[ $? != 0 ]]; then
# we install it
curl -sL http://deb.nodesource.com/setup_5.x | sudo -E bash -
apt-get -y install nodejs
# update npm
npm install -g npm
fi
command -v hubot &>/dev/null || {
npm install -g hubot coffee-script
}
# install yeoman for hubot
command -v yo &>/dev/null || {
npm install -g yo generator-hubot
}
安装的nodejs版本是v5.11.1。安装的npm版本是v3.8.6
安装后,下一步是绞架hubot。 这是通过创建一个新目录来完成的。我将目录命名为myhubot。 当我切换到目录并键入命令:Yo hubot --default时,它开始安装但它以此错误结束:
13519 error Linux 3.13.0-86-generic
13520 error argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "hubot" "hubot-scripts" "hubot-diagnostics" "hubot-help" "hubot-heroku-keepalive" "hubot-google-images" "hubot-google-translate" "hubot-pugme" "hubot-maps" "hubot-redis-brain" "hubot-rules" "hubot-shipit" "--save"
13521 error node v5.11.1
13522 error npm v3.8.6
13523 error path ../coffee-script/bin/coffee
13524 error code EPROTO
13525 error errno -71
13526 error syscall symlink
13527 error EPROTO: protocol error, symlink '../coffee-script/bin/coffee' -> '/vagrant/myhubot/node_modules/.bin/coffee'
13528 error If you need help, you may report this error at:
13528 error <https://github.com/npm/npm/issues>
13529 verbose exit [ -71, true ]
显然,即使在错误日志之后,如果输入“hubot”命令,我也会登录到hubot shell。 但是,当我ping hubot时,我没有收到回复。
发生此错误是因为npm
命令需要符号链接,并且在此问题中引用的Windows不支持它: https : //github.com/npm/npm/issues/9901
您可以按照本文中列出的步骤解决此问题: 使用Vagrant Windows的符号链接
步骤是:
将代码段添加到VagrantFile以启用符号链接:
config.vm.provider "virtualbox" do |v|
v.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"]
end
以管理员模式启动Vagrant机器
这是为了规避Vagrant对符号链接的限制。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.