aws-sam-cli icon indicating copy to clipboard operation
aws-sam-cli copied to clipboard

npm does not work any more after failed installation attempt of aws-sam-local

Open realharry opened this issue 9 years ago • 5 comments

I tried to install it on my Ubuntu workstation (sudo npm i -g aws-sam-local), and it failed with EACCES error.

The README page points to the NPM documentation, whose remedies are questionable (in my view). I decided not to install aws-sam-local. But, since then, I cannot use npm for my local projects any more. I keep getting "Error: EACCES: permission denied" errors. It seems like the failed installation attempt changed ownership of certain npm directories.

It's very likely an aws-sam-local issue (rather than an npm issue).

realharry avatar Nov 29 '17 22:11 realharry

@realharry I'm not sure about your corrupted npm situation, but I had the same issue on an Ubuntu EC2 instance (wasn't able to install w/ npm). In case you want to try installing sam local again, here's what worked for me.

wget https://github.com/awslabs/aws-sam-local/releases/download/v0.2.2/sam_0.2.2_linux_amd64.deb
sudo dpkg -i ./sam_0.2.2_linux_amd64.deb

jebberjeb avatar Nov 30 '17 13:11 jebberjeb

@jebberjeb Thanks for the info. I successfully installed the deb package. Thanks!

realharry avatar Nov 30 '17 18:11 realharry

sudo npm i -g aws-sam-local are you supposed to use sudo with npm -g? sudo will elevate you to superuser, and install recursively installs files. The combination would mean that any shared packages installed would be owned by superuser, and not your actual user -- essentially locking you out of those packages.

iph avatar Dec 07 '17 04:12 iph

@iph is correct - you should not use sudo and it should install just fine without it.

PaulMaddox avatar Dec 07 '17 18:12 PaulMaddox

@PaulMaddox @iph I disagree. What does "-g" mean? In the shared system (like Unix/Linux), global installation should be done by a user with elevated privilege. @PaulMaddox "you should not use sudo and it should install just fine without it." I think you are completely mistaken. If you can do "npm i -g" on your system without sudo, your system is broken.

realharry avatar Dec 07 '17 18:12 realharry