Laravel Homestead,npm install --no-bin-links错误 [英] Laravel Homestead, npm install --no-bin-links error

查看:191
本文介绍了Laravel Homestead,npm install --no-bin-links错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为新的Laravel 5.3应用程序使用新的Homestead(框版本0.5).主机操作系统是Windows 10.

I am using fresh Homestead (box version 0.5) for a fresh Laravel 5.3 app. Host OS is Windows 10.

运行npm install --no-bin-links

npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm ERR! Linux 4.4.0-22-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--no-bin-links"
npm ERR! node v5.12.0
npm ERR! npm  v3.8.6

npm ERR! Maximum call stack size exceeded
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! /home/vagrant/t1/t1/npm-debug.log

npm-debug.log

npm-debug.log

.........
71199 silly build replace-ext@0.0.1
71200 silly build vinyl@1.2.0
71201 silly build require-dir@0.3.1
71202 silly build require-directory@2.1.1
71203 silly build require-main-filename@1.0.1
71204 silly build resolve@1.1.7
71205 silly build rechoir@0.6.2
71206 silly build resolve-url@0.2.1
71207 silly build rev-hash@1.0.0
71208 silly build rev-path@1.0.0
71209 silly build right-align@0.1.3
71210 verbose stack RangeError: Maximum call stack size exceeded
71210 verbose stack     at process.stderr (internal/process/stdio.js:23:46)
71210 verbose stack     at isTTY (/usr/lib/node_modules/npm/node_modules/npmlog/node_modules/gauge/progress-bar.js:11:17)
71210 verbose stack     at Object.ProgressBar.show (/usr/lib/node_modules/npm/node_modules/npmlog/node_modules/gauge/progress-bar.js:132:8)
71210 verbose stack     at Object.ProgressBar.pulse (/usr/lib/node_modules/npm/node_modules/npmlog/node_modules/gauge/progress-bar.js:124:8)
71210 verbose stack     at EventEmitter.log.emitLog (/usr/lib/node_modules/npm/node_modules/npmlog/log.js:178:40)
71210 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npmlog/log.js:170:8)
71210 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npmlog/log.js:231:21)
71210 verbose stack     at tracker.(anonymous function) [as silly] (/usr/lib/node_modules/npm/node_modules/npmlog/log.js:79:19)
71210 verbose stack     at module.exports (/usr/lib/node_modules/npm/lib/install/action/build.js:8:7)
71210 verbose stack     at actions.(anonymous function) (/usr/lib/node_modules/npm/lib/install/actions.js:48:12)
71211 verbose cwd /home/vagrant/t1/t1
71212 error Linux 4.4.0-22-generic
71213 error argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--no-bin-links"
71214 error node v5.12.0
71215 error npm  v3.8.6
71216 error Maximum call stack size exceeded
71217 error If you need help, you may report this error at:
71217 error     <https://github.com/npm/npm/issues>
71218 verbose exit [ 1, true ]

没有--no-bin-links即可正常工作(当然,如果不在共享文件夹中)

without --no-bin-links it works (of course if not inside of shared folder)

更新的节点和npm(6.9.1,3.10.8),相同的问题.

Updated node and npm (6.9.1, 3.10.8), the same issue.

推荐答案

我已经开发了一种 specific 方法来使其全部起作用.这是基本步骤:

I have developed a particular method to make it all work. Here are the basic steps:

  • 首先,在Vagrant共享文件夹中创建一个目录 .例如,它可能是"/home/vagrant/node ".
  • 就在那儿,我们将从Laravel安装中复制 package.json 文件,以告诉npm要安装什么...请注意,最近创建的'node'目录位于Unix系统中,没有任何内容与我们的Windows主机有关(因为它不是两者之间共享文件夹的一部分).
  • 第三,我们将运行 npm install 命令(不使用--no-bin-links选项,因为Unix支持符号链接.应该没有错误;)
  • 最后,我们将' node_modules '目录直接移回我们的Laravel安装文件夹(共享的文件夹),但是已经从控制台运行了 vagrant up 命令Windows主机中具有管理员权限的用户.否则,尝试移动创建的符号链接将导致错误.
  • First, make a directory out of the Vagrant shared folder. It could be, e.g., '/home/vagrant/node'.
  • Right there, we would copy the package.json file from our Laravel installation to tell npm what to install... Note that the recently created 'node' directory is in a Unix system, nothing to do with our Windows host machine (as it is not part of a shared folder between both).
  • Third, we would run npm install command (without the --no-bin-links options as Unix supports symbolic links. There should be no errors ;)
  • Finally, we would move the 'node_modules' directory right back to our Laravel installation folder (the shared one), BUT having run the vagrant up command from a console with Admin Privileges in Windows host machine. Otherwise, trying to move the created symbolic links would result in an error.

因为它是为Laravel应用程序提供服务的Unix机器,所以一切都会正常工作. 此过程将帮助您毫无问题地安装Laravel Mix.

It will all work as it is the Unix machine that serves the Laravel app. This process will help you install Laravel Mix without problems.

干杯!

这篇关于Laravel Homestead,npm install --no-bin-links错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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