You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Place the below Vagrantfile, package.json and main.js in a folder and cd to it
vagrant up then vagrant ssh
cd /vagrant
npm start
Vagrantfile :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/jammy64"
# Install Node.JS
config.vm.provision "shell", name: "Install Node.JS", env: { "NODE_MAJOR" => "18" }, inline: <<-SHELL
# Install necessary packages for downloading and verifying new repository information
apt-get install -y ca-certificates curl gnupg
# Create a directory for the new repository's keyring, if it doesn't exist
mkdir -p /etc/apt/keyrings
# Download the new repository's GPG key and save it in the keyring directory
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
# Add the new repository's source list with its GPG key for package verification
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_MAJOR}.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
# Update local package index to recognize the new repository
sudo apt-get update
# Install Node.js from the new repository
sudo apt-get install -y nodejs
SHELL
end
package.json :
{
"scripts": {
"start": "node main.js"
}
}
main.js:
console.log('Hello world');
How often does it reproduce? Is there a required condition?
Systematic
What is the expected behavior? Why is that the expected behavior?
npm start should run the script
What do you see instead?
$ npm start
npm ERR! code ENOTSUP
npm ERR! syscall read
npm ERR! path /vagrant/host-workspace/node-issue-51511/package.json
npm ERR! errno -95
npm ERR! ENOTSUP: operation not supported on socket, read
npm ERR! A complete log of this run can be found in:
npm ERR! /home/[REDACTED]/.npm/_logs/2024-01-18T10_55_14_965Z-debug-0.log
Complete 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 2ms
6 timing config:load:builtin Completed in 2ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 1ms
9 timing config:load:file:/vagrant/host-workspace/node-issue-51511/.npmrc Completed in 1ms
10 timing config:load:project Completed in 3ms
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 11ms
17 timing npm:load:configload Completed in 11ms
18 timing npm:load:mkdirpcache Completed in 0ms
19 timing npm:load:mkdirplogs Completed in 0ms
20 verbose title npm start
21 verbose argv "start"
22 timing npm:load:setTitle Completed in 1ms
23 timing config:load:flatten Completed in 4ms
24 timing npm:load:display Completed in 5ms
25 verbose logfile logs-max:10 dir:/home/[REDACTED]/.npm/_logs/2024-01-18T10_55_14_965Z-
26 verbose logfile /home/[REDACTED]/.npm/_logs/2024-01-18T10_55_14_965Z-debug-0.log
27 timing npm:load:logFile Completed in 8ms
28 timing npm:load:timers Completed in 0ms
29 timing npm:load:configScope Completed in 0ms
30 timing npm:load Completed in 26ms
31 silly logfile start cleaning logs, removing 1 files
32 timing config:load:flatten Completed in 0ms
33 silly logfile done cleaning log files
34 timing command:run-script Completed in 2ms
35 timing command:start Completed in 9ms
36 verbose stack Error: ENOTSUP: operation not supported on socket, read
37 verbose cwd /vagrant/host-workspace/node-issue-51511
38 verbose Linux 6.5.0-kali3-amd64
39 verbose node v18.19.0
40 verbose npm v9.2.0
41 error code ENOTSUP
42 error syscall read
43 error path /vagrant/host-workspace/node-issue-51511/package.json
44 error errno -95
45 error ENOTSUP: operation not supported on socket, read
46 verbose exit -95
47 timing npm Completed in 51ms
48 verbose code -95
49 error A complete log of this run can be found in:
49 error /home/[REDACTED]/.npm/_logs/2024-01-18T10_55_14_965Z-debug-0.log
Version
v18.19.0
Platform
Linux [REDACTED] 6.5.0-kali3-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.5.6-1kali1 (2023-10-09) x86_64 GNU/Linux
Subsystem
No response
What steps will reproduce the bug?
Steps to reproduce
Vagrantfile
:package.json
:main.js
:How often does it reproduce? Is there a required condition?
Systematic
What is the expected behavior? Why is that the expected behavior?
npm start
should run the scriptWhat do you see instead?
Complete log :
Additional information
Original issue has been filed on the vagrant project : hashicorp/vagrant#13263
The text was updated successfully, but these errors were encountered: