npm install errors with Error: ENOENT, chmod
Ok it looks like NPM is using your .gitignore
as a base for the .npmignore
file, and thus ignores /lib
. If you add a blank .npmignore
file into the root of your application, everything should work.
A better, more explicit approach is to use an allow-list rather than a disallow-list, and use the "files" field in package.json to specify the files in your package.
[edit] - more info on this behaviour here: https://docs.npmjs.com/cli/v7/using-npm/developers#keeping-files-out-of-your-package
Vagrant filesystem issues with npm
I have been experiencing similar issues with Vagrant 1.8.7 and Virtualbox 5.1.10. I was able to fix the filesystem readonly problematic by reducing the number of cpu cores to 1:
config.vm.provider "virtualbox" do |v|
v.cpus = 1
end
Build issues are still occuring for me (npm modules not being found, ENOENT, ELIFECYCLE,...) but at a lesser rate. Unfortunately I have not been able to locate the root cause of these errors.
In my setup npm is not writing into the shared directory. If the write location is the shared folder you can try a different syncing mechanism that gets around some limitations of the virtualbox shared folder implementation.
trying to install mongodb via npm and getting EINVAL errors
One way to fix this would be to override chown() by LD_PRELOAD to interpose a function which always returns zero ("success"). So instead of
#npm install
you would do
#echo "int chown() { return 0; }" > preload.c && gcc -shared -o preload.so preload.c
#LD_PRELOAD=$PWD/preload.so npm install
Related Topics
Shell Script for Process Monitoring
What Does the Line '!/Bin/Sh -E' Do
Can't Source Script in a Current Directory
Sudoers Nopasswd: Sudo: No Tty Present and No Askpass Program Specified
What Are Some Conditions That May Cause Fork() or System() Calls to Fail on Linux
Split Delimited File into Smaller Files by Column
Bluetooth Error: Native Library Bluecove_Arm Not Available
Difference Between Kernel, Kernel-Thread and User-Thread
Windows Equivalent of ./ (Current Directory)
How to Copy a File with '$' in Name in Linux
Bash Scripting - Iterating Through "Variable" Variable Names for a List of Associative Arrays
How to Set Dt_Rpath or Dt_Runpath
Sync Two Computers Going Through a Bridge with Rsync
If Adding a Command That Repeats Every 10 Minutes to Crontab, When Does the First Job Run
I.Mx35 Suspend CPU and Ddr2 from Iram
Access Denied to Android.Git.Kernel.Org
How to Save the Execution Log When We Run a Command Using Putty/Plink