PHP项目Vagrant设置错误[NodeJs安装步骤]

时间:2017-10-05 06:08:14

标签: node.js npm vagrant virtualbox symlink

我正在使用WINDOWS 10上的虚拟框上的vagrant设置我的PHP项目,在命令行上当我点击

vagrant up

安装开始,在设置过程中执行此步骤

==> default: TASK [app : Angular - Install dependencies]

我收到此错误

        ==> default: TASK [app : Angular - Install dependencies] ************************************
    ==> default: fatal: [10.91.0.102]: FAILED! => {"changed": true, "cmd": "npm install", "delta": "0:06:23.111672", "end": "2017-10-05 05:46:47.136976", 
    "failed": true, "msg": "non-zero return code", "rc": 185, "start": "2017-10-05 05:40:24.025304", "stderr": "npm WARN deprecated typings@2.1.1: 
    Typings is deprecated in favor of NPM @types -- see README for more information\nnpm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue\nnpm WARN optional
     SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):\nnpm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {\"os\":\"darwin\",\"arch\":\"any\"} 
     (current: {\"os\":\"linux\",\"arch\":\"x64\"})\nnpm WARN ngx-bootstrap@2.0.0-beta.6 requires a peer of @angular/common@>=4.3.0
     but none was installed.\nnpm WARN ngx-bootstrap@2.0.0-beta.6 requires a peer of @angular/compiler@>=4.3.0 but none was installed.\nnpm WARN ngx-bootstrap@2.0.0-beta.6 requires a peer of @angular/core@>=4.3.0
     but none was installed.\nnpm WARN ngx-bootstrap@2.0.0-beta.6 requires a peer of @angular/forms@>=4.3.0 but none was installed.\nnpm WARN ngx-bootstrap@2.0.0-beta.6 requires a peer of rxjs@>=5.4.3 
     but none was installed.\nnpm WARN ngx-bootstrap@2.0.0-beta.6 requires a peer of typescript@>=2.4.2 but none was installed.\nnpm ERR! Linux 3.13.0-132-generic\nnpm ERR! argv \"/usr/local/bin/node\" \"/usr/local/bin/npm\" 
     \"install\"\nnpm ERR! node v7.0.0\nnpm ERR! npm  v3.10.8\nnpm ERR! path ../typescript/bin/tsserver\nnpm ERR! code EPROTO\nnpm ERR! errno -71\nnpm ERR! syscall symlink\n\nnpm 
     ERR! EPROTO: protocol error, symlink '../typescript/bin/tsserver' -> '/vagrant/angular_admin/node_modules/@angular-devkit/build-optimizer/node_modules/.bin/tsserver'\nnpm ERR! \nnpm ERR! If you need help,
     you may report this error at:\nnpm ERR!     <https://github.com/npm/npm/issues>\n\nnpm ERR! Please include the following file with any support request:\nnpm ERR!    
     /vagrant/angular_admin/npm-debug.log", "stderr_lines": ["npm WARN deprecated typings@2.1.1: Typings is deprecated in favor of NPM @types -- see README for more information", "npm WARN deprecated minimatch@0.3.0: 
     Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue", "npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):", 
     "npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {\"os\":\"darwin\",\"arch\":\"any\"} (current: {\"os\":\"linux\",\"arch\":\"x64\"})", "npm WARN ngx-bootstrap@2.0.0-beta.6 
     requires a peer of @angular/common@>=4.3.0 but none was installed.", "npm WARN ngx-bootstrap@2.0.0-beta.6 requires a peer of @angular/compiler@>=4.3.0 but none was installed.", "npm WARN ngx-bootstrap@2.0.0-beta.6 
     requires a peer of @angular/core@>=4.3.0 but none was installed.", "npm WARN ngx-bootstrap@2.0.0-beta.6 requires a peer of @angular/forms@>=4.3.0 but none was installed.", "npm WARN ngx-bootstrap@2.0.0-beta.6
     requires a peer of rxjs@>=5.4.3 but none was installed.", "npm WARN ngx-bootstrap@2.0.0-beta.6 requires a peer of typescript@>=2.4.2 but none was installed.", "npm ERR! Linux 3.13.0-132-generic", 
     "npm ERR! argv \"/usr/local/bin/node\" \"/usr/local/bin/npm\" \"install\"", "npm ERR! node v7.0.0", "npm ERR! npm  v3.10.8", "npm ERR! path ../typescript/bin/tsserver", "npm ERR! code EPROTO", "npm ERR! errno -71",
     "npm ERR! syscall symlink", "", "npm ERR! EPROTO: protocol error, symlink '../typescript/bin/tsserver' -> '/vagrant/angular_admin/node_modules/@angular-devkit/build-optimizer/node_modules/.bin/tsserver'", "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/angular_admin/npm-debug.log"], "stdout": "angular_admin@2.0.1 /vagrant/angular_admin\n├── @angular/animations@4.0.3 \n├── UNMET PEER DEPENDENCY @angular/common@4.0.3\n├── UNMET PEER DEPENDE

错误太长了,所以我只是复制了它的开头部分。

现在显示此错误http://mysticpaste.com/3OP1NJG73p

非常感谢任何帮助。

1 个答案:

答案 0 :(得分:1)

看起来您无法使用符号链接。

您有几个选择:

  • 尝试将--no-bin-links标志添加到npm install命令或进行设置 在全局配置中作为默认值(npm config set bin-links false)。
  • 如果您在Windows上运行Vagrant,请尝试运行 vagrant up为addministrator。

如果您不想以管理员身份运行VirtualBox,则可以允许为所有用户创建符号链接:

  • 打开本地组策略编辑器(gpedit.msc
  • 在以下位置编辑Create symbolic links政策:计算机配置→Windows设置→安全设置→本地 政策→用户权利分配→创建符号链接