eacces error whlle running npm install -g composer-cli - node.js

npm ERR! code EACCES
npm ERR! syscall rename
npm ERR! path /home/akash2/.npm-packages/lib/node_modules/.staging/grpc-b403b8a1/node_modules/mkdirp
npm ERR! dest /home/akash2/.npm-packages/lib/node_modules/.staging/mkdirp-13f83417
npm ERR! errno -13
npm ERR!
npm ERR! Your cache folder contains root-owned files, due to a bug in
npm ERR! previous versions of npm which has since been addressed.
npm ERR!
npm ERR! To permanently fix this problem, please run:
npm ERR! sudo chown -R 1000:1000 "/home/akash2/.npm"
npm ERR! A complete log of this run can be found in:
npm ERR! /home/akash2/.npm/_logs/2021-05-07T05_37_52_411Z-debug.log
These are the errors. I am trying to fix this, but can't.

Related

npm Error in Vs code using os Linux(Ubuntu)?

enter image description here
protons#protons-HP-EliteBook-840-G3:~/Desktop/NH_Facility_Portal_V0$ npm install --legacy-peer-deps
npm ERR! code ENOTEMPTY
npm ERR! syscall rename
npm ERR! path /home/protons/Desktop/NH_Facility_Portal_V0/node_modules/npm
npm ERR! dest /home/protons/Desktop/NH_Facility_Portal_V0/node_modules/.npm-IgU3U5Pl
npm ERR! errno -39
npm ERR! ENOTEMPTY: directory not empty, rename '/home/protons/Desktop/NH_Facility_Portal_V0/node_modules/npm' -> '/home/protons/Desktop/NH_Facility_Portal_V0/node_modules/.npm-IgU3U5Pl'
npm ERR! A complete log of this run can be found in:
npm ERR! /home/protons/.npm/_logs/2022-07-04T03_19_39_491Z-debug-0.log
protons#protons-HP-EliteBook-840-G3:~/Desktop/NH_Facility_Portal_V0$
protons#protons-HP-EliteBook-840-G3:~/Desktop/NH_Facility_Portal_V0$ sudo npm install --legacy-peer-deps
npm ERR! code ENOTEMPTY
npm ERR! syscall rename
npm ERR! path /home/protons/Desktop/NH_Facility_Portal_V0/node_modules/npm
npm ERR! dest /home/protons/Desktop/NH_Facility_Portal_V0/node_modules/.npm-IgU3U5Pl
npm ERR! errno -39
npm ERR! ENOTEMPTY: directory not empty, rename '/home/protons/Desktop/NH_Facility_Portal_V0/node_modules/npm' -> '/home/protons/Desktop/NH_Facility_Portal_V0/node_modules/.npm-IgU3U5Pl'
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-07-04T03_20_01_694Z-debug-0.log
protons#protons-HP-EliteBook-840-G3:~/Desktop/NH_Facility_Portal_V0$ ^C
protons#protons-HP-EliteBook-840-G3:~/Desktop/NH_Facility_Portal_V0$
Try deleting the node_modules folder using rm -r node_modules and do npm install

Getting prebuild-install || node-gyp rebuild while installing couchbase#2.5.1

System
Version - couchbase in package.json
"couchbase": "2.5.1"
I am getting the below error while doing npm i
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! couchbase#2.5.1 install: `prebuild-install || node-gyp rebuild`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the couchbase#2.5.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/rahul/.npm/_logs/2022-04-19T04_32_43_715Z-debug.log
Tried to install node-gyp
npm install -g node-
Went through https://forums.couchbase.com/t/npm-install-couchbase-failure/17978
But this also didn’t work.

EACCES error while running npm install in jenkins pipeline ... OS: darwin

npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /.npm
npm ERR! errno -13
npm ERR!
npm ERR! Your cache folder contains root-owned files, due to a bug in
npm ERR! previous versions of npm which has since been addressed.
npm ERR!
npm ERR! To permanently fix this problem, please run:
npm ERR! sudo chown -R 1001:1001 "/.
How to resolve this, this is a organization server?
Edit: The $whoami is already the owner of all npm related files and folders

Error while updating to Meteor 1.4

Recently, Meteor has been upgraded to v1.4, well that's great! Unfortunately for me, I cannot upgrade it and have an error log like this.
While loading package npm-bcrypt#0.8.7:
error: Command failed:
/root/.meteor/packages/meteor-tool/.1.4.0.1oo55z5++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/bin/npm
rebuild --no-bin-links --update-binary
sh: 1: node-gyp: Permission denied
npm ERR! Linux 4.4.0-21-generic
npm ERR! argv
"/root/.meteor/packages/meteor-tool/.1.4.0.1oo55z5++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/bin/node"
"/root/.meteor/packages/meteor-tool/.1.4.0.1oo55z5++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/bin/npm"
"rebuild" "--no-bin-links" "--update-binary"
npm ERR! node v4.4.7
npm ERR! npm v3.10.5
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! bcrypt#0.8.7 install: `node-gyp rebuild`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the bcrypt#0.8.7 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the bcrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs bcrypt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls bcrypt
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR!
/root/.meteor/packages/npm-bcrypt/.0.8.7.1i1986o++os.linux.x86_64+web.browser+web.cordova/npm/node_modules/.temp-1fwxhnx/npm-debug.log
sh: 1: node-gyp: Permission denied
npm ERR! Linux 4.4.0-21-generic
npm ERR! argv
"/root/.meteor/packages/meteor-tool/.1.4.0.1oo55z5++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/bin/node"
"/root/.meteor/packages/meteor-tool/.1.4.0.1oo55z5++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/bin/npm"
"rebuild" "--no-bin-links" "--update-binary"
npm ERR! node v4.4.7
npm ERR! npm v3.10.5
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! bcrypt#0.8.7 install: `node-gyp rebuild`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the bcrypt#0.8.7 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the bcrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs bcrypt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls bcrypt
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR!
/root/.meteor/packages/npm-bcrypt/.0.8.7.1i1986o++os.linux.x86_64+web.browser+web.cordova/npm/node_modules/.temp-1fwxhnx/npm-debug.log
I already tried to uninstall and install node js and npm, I thought it will success but the same error still showed up. Can anyone help me?? thank you
A few different solutions for your issue, depending on platform at:
https://github.com/meteor/meteor/issues/7469#issuecomment-235563857
(Meteor problems are usually easier solved through github issues than Stack Overflow Questions)

npm install fails because of chown

I have installed npm locally in ~/.local
Now, I want to install grunt-cli globally in this local install, but I have this output :
npm ERR! Linux 3.19.0-18-generic
npm ERR! argv "/home/etud/(my name)/.local/usr/bin/node" "/home/etud/(my name)/.local/bin/npm" "install" "-g" "grunt-cli"
npm ERR! node v4.1.1
npm ERR! npm v2.14.4
npm ERR! path /home/etud/(my name)/.npm/grunt-cli/0.1.13/package/package.json.ee5c5aa03b9d2c7367d767e1d6e17af3
npm ERR! code Unknown system error -121
npm ERR! errno -121
npm ERR! syscall chown
npm ERR! Unknown system error -121: Unknown system error -121, chown '/home/etud/(my name)/.npm/grunt-cli/0.1.13/package/package.json.ee5c5aa03b9d2c7367d767e1d6e17af3'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /home/etud/(my name)/npm-debug.log
I've done :
$> npm config set -g user=`whoami`
and put this into ~/.npmrc :
root = /home/(my name)/.local/lib/node_modules
binroot = /home/(my name)/.local/bin
manroot = /home/(my name).local/share/man
Any idea ?
EDIT
I'm on my university machine that are working on nfs systems. It seems I can't call the chown command because of problem of user map.
Is there a way to make npm skip any chown ?

Resources