trying to run "brew uninstall node" - node.js

because my npm and node are giving me grief and I want to rinstall them.
Here is the message I get:
Permission denied - /usr/local/Cellar/node/0.10.32/include/node/libplatform/libplatform.h
what's with the Permissions denied?

Sometimes the permissions and/or ownership records can get messed up. Try following the instructions here or running the uninstall again with sudo.

Related

`npm run` giving permission denied

I've started facing an issue today which was not occurring before and no code has been changed on my end.
I'm using Laravel 8 with Laravel Mix and when I run npm run prod I keep getting the following:
> prod
> npm run production
> production
> mix --production
/tmp/production65665869399.sh: 2: mix: Permission denied
Do you have any idea?
I even tried making /tmp directory to have 777 permission and tried to change the owner to be the user I'm logged in as but still the same issue.
It's started all of a sudden and there is no resource about it in the internet.
I'm using Node version 14.15.0 and npm version 8.13.2
This error doesn't occur on my local environment but on AWS Ubuntu server.
Tried to uninstall your node js, and just reinstall it using NVM. Make sure you are not running as root user while installing, hopefully this link can help you:
https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-18-04

GitHub ESLint action failing with "Permission Denied"

I'm writing a CI workflow (GitHub actions), and it seems that eslint is failing with "Permission Denied" code 126. I can't seem to fix it.
Can someone explain why ESlint is failing with permission denied? If so, is there a solution?
Here's a link to the pr where it's failing.
If a GitHub action fails with Permission Denied there are two possibilities:
1. You are trying to run a command that requires elevated privileges
To solve this just prefix sudo. E.g. npx eslint > sudo npx eslint. The GitHub Docs specify:
The Linux and macOS virtual machines both run using passwordless sudo.
2. A shell script does not have the execute filesystem permission set
If you have a unix/bash shell handy, you can change that with:
chmod +x ./.github/scripts/xxx.sh
If not, you can tell git to add the permission with this command:
git update-index --chmod=+x ./.github/scripts/xxx.sh
update-index is similar to add in that it adds the change to the index, so you'll have to commit and push as usual.

pm2 commad always stuck at [PM2] Spawning PM2 daemon with pm2_home=/home/$USER/.pm2

I've been following this issue and till now my problem not solved, anyone can help? Any command of pm2 always returned
[PM2] Spawning PM2 daemon with pm2_home=/home/$USER/.pm2
Thanks
I'm installing node using snap, that's why it didn't work, but it's working now if you install manually, cheers.
You need to either update Node to a newer version or downgrade PM2 to an older version. This solved the issue:
npm uninstall -g pm2
npm install -g pm2#2.5
I am having this issue on window 10 but can't solve problem by uninstall and reinstall pm2.
Finally I found a solution.
Run your command prompt (or) PowerShell as an Administrator
In my case, directory permission wasn't defined correctly for customized PM2_HOME setting
I changed pm2_home as follows:
# ~/.bashrc
export PM2_HOME="/var/www"
The problem was that the current user has no permission to write on /var/www directory. So I changed the directory permission in order to fix it.
Tips:
I created pub.sock and rpc.sock (e.g touch pub.sock) manually when I see the error axon:sock Got error while trying to bind Error: listen EACCES: permission denied /var/www/pub.sock from pm2.log
But when I run DEBUG=* pm2 ls, it makes the CPU over 100% by writting pm2.log (axon:sock Got error while trying to bind Error: listen EACCES: permission denied /var/www/pub.sock)
So create pub.sock and rpc.sock manually!
I experienced this when my disk was full.

Error: EACCES: permission denied NPM Ubuntu Server

I am running an Ubuntu EC2 server and followed the tutorial provided by AWS to install nvm and node, but when I try to run npm install, I'm thrown an error:
Error: EACCES: permission denied, access '/var/www/app'
Please try running this command again as root/Administrator.
The standard procedure with an EC2 Ubuntu service appears to only provide a ubuntu user with sudo privileges and no access to root so I tried to run sudo npm install, but I receive sudo: npm: command not found. The reason why I believe this is happening is because nvm is located at /home/ubuntu/.nvm/versions/node/v6.12.3/bin/node, which root might not have access to?
Is it possible to point root to the this directory location for this command or is there a different solution?
You're getting that error because you do not have write permission for your user on that /var/www/app.
You can follow the answer here to give permissions to that folder.
https://askubuntu.com/questions/749697/how-do-i-give-myself-access-to-var-www-to-create-and-edit-files-and-folders-in
You are getting the error about npm not being installed when you use sudo because it is not installed for the admin user. I would avoid installing node and npm through sudo though. Just go with changing the folder permissions.

Permissions Denied in Terminal

So I am a little new to working in the terminal and trying to set up yo and a localhost environment. No matter what I do it keeps throwing a permissions denied error. I have installed node and npm already and when I run the yo install
npm install -g yo bower grunt-cli gulp i get this error message. My buddy and I have tried so many different things to fix this but we cant get anywhere. I can access and run using sudo but I need to actually have the permissions to get this working. Help please?
I am sorry if that is not detailed enough, I am new to working in the terminal and may not know entirely what I am doing. If all else fails I was going to reset my desktop to factory settings and start over with setting my users and groups.
Screenshot of errors Here
sudo chown -R `whoami` /usr/local
or
npm install npm -g
...will do the trick.
You're not the first one to experience those problems and they are (finally) actively addressed in npm#3.X.X

Resources