noble installation issue
I am trying to install noble module on the hub, but I keep getting the following errors
prebuild-install info begin Prebuild-install version 5.3.5
prebuild-install WARN install EACCES: permission denied, access '/root/.npm'
gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/8.16.1"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/tmp/.node-gyp"
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/pi/code/node/newproject/node_modules/usb/build'
gyp ERR! System Linux 4.19.66-v7+
gyp ERR! command "/usr/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/code/node/requpe/node_modules/usb
gyp ERR! node -v v8.16.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Comments
Use sudo...
Thank you, Laura! I always use sudo. The issue I have because NPM is being installed under root. The way to fix this issue either reinstall npm with a node version manager or manually change npm’s default directory. but I su root I did not know the root password, but I changed it and was able to install it after I switched to root. for some reason pi username was not able to access '/root/.npm' even with sudo. The issue is fixed for me. Thank you !!