This snippet is more of an FYI rather than the usual problem plus solution. I ran into this issue recently where I was trying to build a nodejs project in Ubuntu running on Virtualbox.
In this client setup, there is a need to run certain commands/processes in the development environment in Windows, and others in Ubuntu. To help with this, I end up putting some of my code in a directory that is shared between the Windows host and the Ubuntu VM.
This setup causes an issue with symlink when running certain nodejs builds on the Ubuntu VM. Example of the error is pasted below.
In this case /projects
is a "Shared Folder", which is mounted from c:\develop
on the Windows host.
/projects/project$ uname -a
Linux development 4.4.0-186-generic #216-Ubuntu SMP Wed Jul 1 05:34:05 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
/projects/project$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.6 LTS
Release: 16.04
Codename: xenial
/projects/project$ yarn
yarn install v1.22.4
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
error An unexpected error occurred: "EPROTO: protocol error, symlink '../../../parser/bin/babel-parser.js' -> '/projects/project/node_modules/@babel/core/node_modules/.bin/parser'".
info If you think this is a bug, please open a bug report with the information provided in "/projects/project/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
The workaround is to put the node project in a non-shared folder, and then the error goes away.