将 Vagrant 与 Windows 主机和 Linux 客户机一起使用,grunt
尝试运行作业时返回以下错误。
据我了解,在主机-来宾共享目录中,此文件路径超出了 Windows 的 255 个字符限制。
npm ERR! Error: EPERM, open '/u01/aa/bb/build/share/app-core/app-
ui/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-
wrapper/node_modules/download/node_modules/request/node_modules/form-
data/node_modules/combined-stream/test/integration/test-delayed-streams-and-buffers-
and-strings.js'
我可以在来宾虚拟机上的非共享目录上进行开发,但我更喜欢使用共享目录,因为我在主机上使用 IDE。
我该如何解决这个问题以便我可以运行grunt
在共享目录上?
我在使用角度生成器运行 yeoman 时遇到了类似的问题。我现在找到的解决方案是利用 npm 处理其依赖项的方式的一个小技巧,文件夹结构 https://www.npmjs.org/doc/files/npm-folders.html.
请考虑您遇到的问题可能只影响几个文件(并且可能只影响 imagemin 模块)。
对于 Yeoman,我的解决方案是首先生成,跳过自动启动的安装:
yo angular appname --skip-install
手动启动 Bower 安装:
bower install
从这里开始,您应该会感兴趣:将“request”npm 模块安装为第一级模块(而不是稍后在 imagemin 中深度解决的依赖关系):
npm install request --save-dev
因此,如果您现在运行常规 npm install 来获取其余模块,则会使用现有的请求模块。
npm install --no-bin-links
请注意,使用--no-bin-links
如果你不想运行 VirtualBox 也是一个好主意作为管理员 https://stackoverflow.com/questions/8232778/nodejs-npm-installing-modules-on-ntfs-partition.
那么,回答你的问题。如果您正确设置了软件包并之前调用过 npm install,则运行 grunt 应该可以工作。模块“request”是一个任意模块,可以防止大路径test-delayed-streams-and-buffers-and-strings.js
file.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)