NPM通过package.json安装Express时出错 [英] Error in NPM installing express via package.json

查看:37
本文介绍了NPM通过package.json安装Express时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的节点和npm版本是最新的.但是在./node_modules下出现错误并且没有快速文件夹.Express文件夹位于/home/vagrant/.npm下生成npm-debug.log.不确定如何附加.

My node and npm versions are recent. But getting error and no express folder is coming up under ./node_modules. Express folder is coming up under /home/vagrant/.npm npm-debug.log is generated. Not sure how to attach that.

npm ERR! Linux 3.13.0-68-generic
npm ERR! argv "/home/vagrant/.nvm/versions/node/v4.2.2/bin/node" "/home/vagrant/.nvm/versions/node/v4.2.2/bin/npm" "install"
npm ERR! node v4.2.2
npm ERR! npm  v2.14.7
npm ERR! path ../mime/cli.js
npm ERR! code EPROTO
npm ERR! errno -71
npm ERR! syscall symlink

npm ERR! EPROTO: protocol error, symlink '../mime/cli.js' -> '/vagrant/testProject/node_modules/express/node_modules/send/node_modules/.bin/mime'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Linux 3.13.0-68-generic
npm ERR! argv "/home/vagrant/.nvm/versions/node/v4.2.2/bin/node" "/home/vagrant/.nvm/versions/node/v4.2.2/bin/npm" "install"
npm ERR! node v4.2.2
npm ERR! npm  v2.14.7
npm ERR! path npm-debug.log.f7bc0249588f17bea044ac621dd74bb9
npm ERR! code ETXTBSY
npm ERR! errno -26
npm ERR! syscall rename

推荐答案

您需要使用-no-bin-link 选项运行npm,以告诉npm您的文件系统不支持链接

You need to run npm with -–no-bin-link option to tell npm that your filesystem doesn't support links

如果要在每个npm命令上执行-no-bin-link ,则可以使用以下命令将别名添加到主目录中的 .bashrc 文件中:该命令:

If you want to do the --no-bin-link on each npm command, you can add an alias to your .bashrc file in your home directory with this command:

echo "alias npm='npm --no-bin-links'" >> /home/vagrant/.bashrc

另一种可能性是将您的配置设置为允许Vagrantfile中Windows主机上的符号链接

Another possibility is to set your configuration to allow symlinks on Windows hosts in your Vagrantfile

config.vm.provider "virtualbox" do |v|
    v.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/vagrant", "1"]
end

请参见 https://github.com/npm/npm/issues/7308 了解更多详情

这篇关于NPM通过package.json安装Express时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆