-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot run recent versions of Node.js in Vagrant boxes #13263
Comments
Facing the same ENOTSUP error with Node.js v18.18 in Vagrant. It works fine with v17.x or 16. Watching this thread for solutions. |
Just tried this on another computer, and I am seeing the same behavior there, too. |
@BadIdeaException Are you still encountering this behavior? I used the provided Vagrantfile and everything worked as expected. Would you mind verifying the error still occurs for you on the latest Thanks! |
I'm still seeing the same thing. Guest OS is now:
|
same problem here, any fix? EDIT: The problem seems to be related to virtualbox, after switching to hyperv I don't have this problem. EDIT2: Changing the synced folder type to "smb" seems fix the issue, https://developer.hashicorp.com/vagrant/docs/synced-folders/smb |
@sunxyw I've got the issue too. It's only when npm is installed in a mounted directory (shared directory). So I've moved my npm install directory to a non-shared directory, which works. Not great, but does the trick too. [EDIT] I'm on Virtualbox 7.0, but the issue seems to be on both Vagrant and Virtualbox. |
Same error but just on Virtualbox with a much simpler code residing on a shared directory, so probably same as @dugwood. The problem seems to be specifically related on the node ESModule loader. In fact, the same simple code but running as CommonJS doesn't manifest the issue. Possibly something that node upstream should be informed of. |
Hello, same error here with Kali / Virtualbox / Vagrant mounted folder |
Ran into this issue, and was able to switch to Edit: Had to revert because the |
Hello, how can we help on this issue ? Even a simple "npm install" fails with ENOTSUP when launched on a vagrant fileshare (fstype : vboxfs).
Debug log :
|
I'm stopping notifications on this since I have nothing in production that makes use of this setup but if anyone of you is really serious about seeing this fixed to the root cause, then should create an issue on node doing some further research and reporting these discoveries. |
Done, I guess you can close this issue as it does not seem to be vagrant specific : the underlying filesystem's type is |
Closing this in favor of upstream issue nodejs/node#50876 |
I can also confirm that below vagrant/virtualbox config is also affected by this bug: |
Confirming this still happens, although it's a Node issue, not a Laravel issue. I'm on Ubuntu 23.10 as my baremetal machine, using VirtualBox as a Vagrant provider for Homestead. On the shared folder composer create-project --prefer-dist laravel/laravel code/
cd code/
composer require laravel/breeze --dev works fine, but
does not. Instead it leads to ┌ Which Breeze stack would you like to install? ───────────────┐
│ Blade with Alpine │
└──────────────────────────────────────────────────────────────┘
┌ Would you like dark mode support? ───────────────────────────┐
│ Yes │
└──────────────────────────────────────────────────────────────┘
┌ Which testing framework do you prefer? ──────────────────────┐
│ PHPUnit │
└──────────────────────────────────────────────────────────────┘
INFO Installing and building Node dependencies.
npm ERR! code ENOTSUP
npm ERR! syscall write
npm ERR! errno -95
npm ERR! ENOTSUP: operation not supported on socket, write
npm ERR! A complete log of this run can be found in: /home/vagrant/.npm/_logs/2024-03-03T11_34_39_227Z-debug-0.log
INFO Breeze scaffolding installed successfully. Doing all of this on a non-shared
|
This issue is closed in favor of upstream issue : nodejs/node#50876 |
Recent versions of Node.js (v18.18 and newer) fail with an ENOTSUP error when running NPM commands inside a Vagrant box. I have tried this with both versions from the Nodesource repos and directly from nodejs.org.
This error does not occur with Node.js v17.x.
Debug output
For debug output of
vagrant up
see vagrant.log.Error log of
npm start
:Expected behavior
npm start
should run the script.Actual behavior
Other operations also result in socket errors, i.e.
npm install mocha
:Reproduction information
Vagrant version
Vagrant 2.3.7
Host operating system
Ubuntu Jammy
Guest operating system
Tried with ubuntu/jammy64 and ubuntu/lunar64
Steps to reproduce
Vagrantfile
,package.json
andmain.js
in a folder and cd to itvagrant up
thenvagrant ssh
cd /vagrant
npm start
Vagrantfile
package.json
:main.js
:The text was updated successfully, but these errors were encountered: