Npm Install Causes Errors Like Npm Err! Tar.Unpack Untar Error on Debian

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



Leave a reply



Submit