2016-12-05 111 views
0

只是不知道是否有人能提供一些线索上npm install VirtualBox虚拟机上运行(安装Ubuntu的v16.4)..我得到这个遗憾错误NPM VirtualBox上安装问题与Ubuntu安装

[email protected]:/media/sf_ubuntu/angular$ npm install 
[email protected] /media/sf_ubuntu/angular 
├── UNMET PEER DEPENDENCY @angular/[email protected] 
└── UNMET PEER DEPENDENCY @angular/[email protected] 

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected]^1.0.0 (node_modules/chokidar/node_modules/fsevents): 
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) 
npm WARN [email protected] requires a peer of @angular/[email protected]~2.1.1 but none was installed. 
npm WARN [email protected] requires a peer of @angular/[email protected]~2.1.1 but none was installed. 
npm WARN [email protected] No repository field. 
npm ERR! Linux 4.8.0-22-generic 
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" 
npm ERR! node v6.9.1 
npm ERR! npm v3.10.8 
npm ERR! path ../acorn/bin/acorn 
npm ERR! code EROFS 
npm ERR! errno -30 
npm ERR! syscall symlink 

npm ERR! rofs EROFS: read-only file system, symlink '../acorn/bin/acorn' -> '/media/sf_ubuntu/angular/node_modules/.bin/acorn' 
npm ERR! rofs This is most likely not a problem with npm itself 
npm ERR! rofs and is related to the file system being read-only. 
npm ERR! rofs 
npm ERR! rofs Often virtualized file systems, or other file systems 
npm ERR! rofs that don't support symlinks, give this error. 

npm ERR! Please include the following file with any support request: 
npm ERR!  /media/sf_ubuntu/angular/npm-debug.log 
npm ERR! code 1 
+0

为共享Virtualbox文件夹选择了“只读”吗? – Aurora0001

+0

什么是/ media/sf_ubuntu/angular?它是网络路径还是可移动驱动器?如果是这样,你需要检查它的权限。 – jsalatas

+0

它似乎是一个权限问题。我不得不将package.json移动到Ubuntu硬盘中的文件夹。它现在运行正常。谢谢 –

回答

1

的Virtualbox在安全性方面限制了在共享目录中创建符号链接。所以,你应该打开相关功能:

  1. 关闭VirtualBox的

  2. 的VirtualBox安装路径添加到环境变量PATH

  3. 在cmd中

    VBoxManage setextradata <VM_NAME> VBoxInternal2/SharedFoldersEnableSymlinksCreate/<SHARE_NAME(without the sf_ prefix)> 1

  4. 执行以下命令
  5. 用管理员运行Virtualbox

+1

不知何故上面显示的代码是不完整的。在这里完成代码。 VBoxManage setextradata VBoxInternal2/SharedFoldersEnableSymlinksCreate/ 1 – Sevenskey