我是NodeJS世界的新手。我已经创建了一个loopback(strongloop)Web应用程序,但是在尝试运行该应用程序文件夹中的npm install命令后,我在终端中得到了此输出(Ubuntu服务器14.04具有最新的更新-在一个流浪汉实例中)

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

{
  "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运行,但得到的结果完全相同。

版本:


节点v4.1.0
Npm v2.14.3
流浪汉1.7.4
Ubuntu Server 14.04.3(具有最新更新)


这是npm-log file,它很长。

如果您知道我的错误,请不要犹豫,只需回答:)

最佳答案

这是Vagrant / VirtualBox的问题。不幸的是,同步/共享的文件系统不支持符号链接。

如果您不需要此功能,最简单的操作就是在Vagrantfile中将其禁用:

# ...
config.vm.synced_folder ".", "/vagrant", disabled: true
# ...


如果确实需要它,您现在可以找到解决办法,因为您知道它与symlink支持有关,npm用于创建bins :-)

有关更多详细信息,请参见https://docs.vagrantup.com/v2/synced-folders/basic_usage.html

关于node.js - 我尝试在回送(strongloop)Webapp中安装依赖项时出现Npm错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/32666983/

10-09 20:53