Closed BadIdeaException closed 5 months ago
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 ubuntu/jammy64
box release?
Thanks!
I'm still seeing the same thing. Guest OS is now:
uname -a
:
Linux ubuntu-jammy 5.15.0-84-generic #93-Ubuntu SMP Tue Sep 5 17:16:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
vagrant box list
...
ubuntu/jammy64 (virtualbox, 20230929.0.0)
...
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 type: "smb"
for the synced_folder and it resolved the issue. I haven't been on it long enough to determine if that new type is going to open up it's own problems, but for now stuff appears to be working.
Edit: Had to revert because the smb
was simply too slow to be usable... back to trying to find answers.
Hello, how can we help on this issue ? Even a simple "npm install" fails with ENOTSUP when launched on a vagrant fileshare (fstype : vboxfs).
─$ npm install
npm ERR! code ENOTSUP
npm ERR! syscall write
npm ERR! errno -95
npm ERR! ENOTSUP: operation not supported on socket, write
Debug log :
─$ cat /home/[REDACTED]/.npm/_logs/2024-01-18T07_16_55_123Z-debug-0.log
0 verbose cli /usr/bin/node /usr/bin/npm
1 info using npm@9.2.0
2 info using node@v18.19.0
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 2ms
5 timing config:load:file:/usr/share/nodejs/npm/npmrc Completed in 3ms
6 timing config:load:builtin Completed in 3ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:/vagrant/host-workspace/[REDACTED]/.npmrc Completed in 0ms
10 timing config:load:project Completed in 5ms
11 timing config:load:file:/home/[REDACTED]/.npmrc Completed in 0ms
12 timing config:load:user Completed in 0ms
13 timing config:load:file:/etc/npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:setEnvs Completed in 1ms
16 timing config:load Completed in 12ms
17 timing npm:load:configload Completed in 12ms
18 timing npm:load:mkdirpcache Completed in 4ms
19 timing npm:load:mkdirplogs Completed in 0ms
20 verbose title npm install
21 verbose argv "install"
22 timing npm:load:setTitle Completed in 1ms
23 timing config:load:flatten Completed in 3ms
24 timing npm:load:display Completed in 4ms
25 verbose logfile logs-max:10 dir:/home/[REDACTED]/.npm/_logs/2024-01-18T07_16_55_123Z-
26 verbose logfile /home/[REDACTED]/.npm/_logs/2024-01-18T07_16_55_123Z-debug-0.log
27 timing npm:load:logFile Completed in 7ms
28 timing npm:load:timers Completed in 0ms
29 timing npm:load:configScope Completed in 0ms
30 timing npm:load Completed in 28ms
31 silly logfile start cleaning logs, removing 1 files
32 timing config:load:flatten Completed in 0ms
33 timing arborist:ctor Completed in 0ms
34 silly logfile done cleaning log files
35 timing arborist:ctor Completed in 0ms
36 timing idealTree:init Completed in 11ms
37 timing idealTree:userRequests Completed in 0ms
38 silly idealTree buildDeps
39 timing idealTree:#root Completed in 0ms
40 timing idealTree:buildDeps Completed in 1ms
41 timing idealTree:fixDepFlags Completed in 0ms
42 timing idealTree Completed in 13ms
43 timing reify:loadTrees Completed in 14ms
44 timing reify:diffTrees Completed in 0ms
45 silly reify moves {}
46 timing reify:retireShallow Completed in 1ms
47 timing reify:createSparse Completed in 0ms
48 timing reify:loadBundles Completed in 0ms
49 timing reify:unpack Completed in 0ms
50 timing reify:unretire Completed in 0ms
51 timing build:queue Completed in 0ms
52 timing build:deps Completed in 1ms
53 timing build Completed in 1ms
54 timing reify:build Completed in 1ms
55 timing reify:trash Completed in 0ms
56 timing command:install Completed in 26ms
57 verbose stack Error: ENOTSUP: operation not supported on socket, write
58 verbose cwd /vagrant/host-workspace/[REDACTED]
59 verbose Linux 6.5.0-kali3-amd64
60 verbose node v18.19.0
61 verbose npm v9.2.0
62 error code ENOTSUP
63 error syscall write
64 error errno -95
65 error ENOTSUP: operation not supported on socket, write
66 verbose exit -95
67 timing npm Completed in 71ms
68 verbose unfinished npm timer reify 1705562215167
69 verbose unfinished npm timer reify:save 1705562215187
70 verbose code -95
71 error A complete log of this run can be found in:
71 error /home/[REDACTED]/.npm/_logs/2024-01-18T07_16_55_123Z-debug-0.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 vboxfs
.
Closing this in favor of upstream issue https://github.com/nodejs/node/issues/50876
I can also confirm that below vagrant/virtualbox config is also affected by this bug: Virtualbox: 6.1 Vagrant box: bento/ubuntu-22.04 (>=202309.08.0)
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 code/
,
composer create-project --prefer-dist laravel/laravel code/
cd code/
composer require laravel/breeze --dev
works fine, but
php artisan breeze:install
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 testdir/
works fine, but I can't move everything in testdir/
to code/
, which is annoying.
Gonna try setting up a QEMU provider to see if that works better. EDIT: QEMU is not supported by Homestead (fair!). API only and HTMX it'll have to be!
This issue is closed in favor of upstream issue : https://github.com/nodejs/node/issues/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
: