问题
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
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?
回答1:
What worked for me was to start windows command prompt as Administrator and vagrant up
from there.
The problem was, that windows as a Host machine, needs administrator privileges to create symlinks
.
to get a rid of previous unsuccessful installation I run npm clean-install
npm run dev still ends up with some errors but ui:auth
works.
回答2:
In case you want npm to stop from creating symlinks for you, you can avoid that by
npm install --no-bin-links
more information about it on npm documentation https://docs.npmjs.com/cli/install.html
Note: This might have some unknown side effects, this methods worked fine for an application I was working on and when I encountered this issue. The side effects might be related to symlink, which npm is trying to create, and in the later phase of development it finds out that the symlink is not available.
回答3:
What worked for me was this. In the Homestead environment I used:
sudo su
then run again
npm install
来源:https://stackoverflow.com/questions/56729305/npm-err-eproto-protocol-error-symlink-babel-parser-bin-babel-parser-js