npm 错误!EPROTO:协议错误,符号链接 '../@babel/parser/bin/babel-parser.js' ->'/home/vagrant/code/proadco.test/node_modules/.bin/parser' [英] npm ERR! EPROTO: protocol error, symlink '../@babel/parser/bin/babel-parser.js' -> '/home/vagrant/code/proadco.test/node_modules/.bin/parser'

查看:364
本文介绍了npm 错误!EPROTO:协议错误,符号链接 '../@babel/parser/bin/babel-parser.js' ->'/home/vagrant/code/proadco.test/node_modules/.bin/parser'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在 Windows 8.1 上的 Git Bash 客户端中执行 npm install,但收到以下错误:

I'm attempting to execute npm install in Git Bash client on Windows 8.1 but receiving the following error:

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: minimist@1.2.0 (node_modules/fsevents/node_modules/rc/node_modules/minimist):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, open '/home/vagrant/code/proadco.test/node_modules/fsevents/node_modules/rc/node_modules/minimist/package.json.737544774'

npm ERR! path ../@babel/parser/bin/babel-parser.js
npm ERR! code EPROTO
npm ERR! errno -71
npm ERR! syscall symlink
npm ERR! EPROTO: protocol error, symlink '../@babel/parser/bin/babel-parser.js' -> '/home/vagrant/code/mysite.test/node_modules/.bin/parser'

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/vagrant/.npm/_logs/2019-06-24T02_39_32_641Z-debug.log

运行 npm install --no-bin-links 可以让它成功运行.但我并不完全了解这一行动的后果.我相信它是在说不要创建符号链接.这只是一个黑客而不是解决问题的根源.但我读过 Windows 不支持符号链接,因此无法解决.

Running npm install --no-bin-links allows it to run successfully. But I don't full understand the consequences of this action. I believe it's saying "Don't create a symlink. Which is just a hack instead of resolving the root of the issue. But I've read that Windows doesn't support symlinks so it's impossible to solve.

谁能解释一下这里的后果是什么?以及如何克服符号链接的根本问题?

Can someone explain what the consequences here are? And possibly how to overcome the root issue of symlinks?

推荐答案

对我有用的是以 Administratorvagrant up 的身份启动 Windows 命令提示符.

What worked for me was to start Windows command prompt as Administrator and vagrant up from there.

如果 Vagrant 已经在运行,您需要在新启用管理员的命令提示符中在 vagrant up 之前运行 vagrant suspend.

If Vagrant is already running, you will need to run vagrant suspend before vagrant up in your newly administrator-enabled command prompt.

问题在于Vagrant 进程需要管理员权限来创建符号链接.

为了摆脱之前不成功的安装,我运行了 npm clean-install.npm run dev 仍然会出现一些错误,但 ui:auth 有效.

To get a rid of a previous unsuccessful installation, I ran npm clean-install. npm run dev still ends up with some errors but ui:auth works.

这篇关于npm 错误!EPROTO:协议错误,符号链接 '../@babel/parser/bin/babel-parser.js' ->'/home/vagrant/code/proadco.test/node_modules/.bin/parser'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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