我尝试在回送(strongloop)Webapp中安装依赖项时出现Npm错误 [英] Npm errors while I try to install dependencies in loopback (strongloop) webapp
问题描述
我是NodeJS世界的新手.我已经创建了一个loopback(strongloop)Web应用程序,但是在尝试运行该应用程序文件夹中的npm install
命令之后,我在终端机上获得了此输出(Ubuntu服务器14.04具有最新的更新-在一个流浪汉实例中)
I am new in the NodeJS world. I have created an loopback(strongloop) webapp, but after it I try to run the npm install
command in the application's folder I get this output in the terminal (Ubuntu server 14.04 withd newest updates - in a vagrant instance)
vagrant@vagrant-ubuntu-trusty-64:/vagrant/example-app$ npm install
npm WARN package.json example-app@1.0.0 No license field.
npm WARN optional dep failed, continuing ycssmin@1.0.1
npm WARN deprecated jsonstream@1.0.3: use JSONStream instead
npm WARN optional dep failed, continuing request@2.62.0
npm WARN optional dep failed, continuing loopback-explorer@1.8.0
npm ERR! Linux 3.13.0-62-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v4.1.0
npm ERR! npm v2.14.3
npm ERR! path ../node-uuid/bin/uuid
npm ERR! code EPROTO
npm ERR! errno -71
npm ERR! syscall symlink
npm ERR! EPROTO: protocol error, symlink '../node-uuid/bin/uuid' -> '/vagrant/example-app/node_modules/loopback-datasource-juggler/node_modules/.bin/uuid'
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-62-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v4.1.0
npm ERR! npm v2.14.3
npm ERR! path npm-debug.log.2d5bb41273f18b2da30958b9aa61bfe6
npm ERR! code ETXTBSY
npm ERR! errno -26
npm ERR! syscall rename
npm ERR! ETXTBSY: text file is busy, rename 'npm-debug.log.2d5bb41273f18b2da30958b9aa61bfe6' -> 'npm-debug.log'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /vagrant/example-app/npm-debug.log
这是由回送框架生成的package.json
:
This is the generated package.json
which has been generated by loopback framework:
{
"name": "example-app",
"version": "1.0.0",
"main": "server/server.js",
"scripts": {
"pretest": "jshint ."
},
"dependencies": {
"compression": "^1.0.3",
"cors": "^2.5.2",
"loopback": "^2.22.0",
"loopback-boot": "^2.6.5",
"loopback-datasource-juggler": "^2.39.0",
"serve-favicon": "^2.0.1"
},
"optionalDependencies": {
"loopback-explorer": "^1.1.0"
},
"devDependencies": {
"jshint": "^2.5.6"
},
"repository": {
"type": "",
"url": ""
},
"description": "example-app"
}
我尝试使用sudo npm install
运行,但是得到的结果完全相同.
I have tried to run with sudo npm install
but I have gotten exactly the same result.
版本:
- 节点v4.1.0
- Npm v2.14.3
- 流浪者1.7.4
- Ubuntu Server 14.04.3(具有最新更新)
这是 npm日志文件,它很长.
如果您知道我的错误,请不要犹豫,只需回答:)
推荐答案
这是Vagrant/VirtualBox的问题.不幸的是,同步/共享的文件系统不支持符号链接.
This is a problem with Vagrant/VirtualBox. Unfortunately, the synced/shared filesystem doesn't support symlinks.
如果您不需要此功能,最简单的方法是在Vagrantfile
中将其禁用:
If you don't require this functionality, the easiest thing to do is to just disable it in your Vagrantfile
:
# ...
config.vm.synced_folder ".", "/vagrant", disabled: true
# ...
如果确实需要它,您现在就可以找到解决方法,因为您知道它与symlink支持有关,npm用来创建bins:-)
If you do require it, you may be able to find a work around now that you know it is a problem with symlink support, which npm uses for creating bins :-)
请参见 https://docs.vagrantup.com/v2/synced-folders /basic_usage.html 了解更多详情.
这篇关于我尝试在回送(strongloop)Webapp中安装依赖项时出现Npm错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!