-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sudo npm install fails #66
Comments
This is a problem because the post-install npm script runs as non-sudo user, however A solution would be to have go-npm download binaries to /tmp directory instead of |
Does this happen on npm v4.x as well? I only ask because npm@5 has changed the way permissions are being used and that's caused some bugs for install scripts + root, ie: npm/npm#17851 |
It happens on npm 2 actually, whatever is bundled with Node 4.3.0 |
Ah, yeah, I should've spotted that from the install log – ok, probably not related then! |
Use os.tmpdir() ? |
Hmm, I'm getting the same issue with a sudo install. But without a sudo I get other permissions issues:
|
@georgmao - on my machine, Maybe the first time you ran |
For some reason mine was some weird user:
A chown to my user fixed it 👍
|
I have the same issue:
Downloading from URL: https://github.com/awslabs/aws-sam-local/releases/download/v0.2.0/sam_0.2.0_linux_amd64.tar.gz Error: EACCES: permission denied, rename 'bin/sam' -> '/usr/local/bin/sam' |
Might be worth adding this to the documentation? https://docs.npmjs.com/getting-started/fixing-npm-permissions |
(Option 1 from that document should fix most ppl's permissions issues)
|
yeah looks good to me. |
sudo chown -R did the trick from me. Thanks mhart |
For those who look only on last comment (like me): don't use |
This pull request on Installing |
Not sure this issue should be closed. I have followed the steps from Option 2 from the NPM fixing-npm-permissions post If anyone wants to reproduce, I am attempting to install sam-local into the following Docker image: https://hub.docker.com/r/cloudbees/jnlp-slave-with-java-build-tools/tags/ (tag 2.0.1)
Run as root:
|
In windows I have the same error:
|
Following fixed for me npm config set unsafe-perm=true |
pankajsamsung's "npm config" change above fixed it for my issue, thx |
last solution worked for me in Windows bash environment |
Setting unsafe-perm=true did not fix this for me. Windows 10, gitbash shell, node 8.9.1, npm 5.5.1
|
|
pankajsamsung's fix worked for me as well |
worked for me on mac os |
worked for me on mac sierra too. Thanks @Rajjae |
npm config set unsafe-perm=true |
Installed Node.js through |
npm install -g go-npm then npm install -g aws-sam-local worked for me |
worked for me on Ubuntu 16.04 LTS with
|
Confirm, I had issues both on my Ubuntu 16.04 LTS and on my Oracle Linux 7 VM. npm config set unsafe-perm=true |
After setting
|
I have npm -v But what does mean unsafe-perm? |
Worked for me on Ubuntu 16.04 with
|
Still required in 2019! npm config set unsafe-perm=true |
@iceback We no longer support npm and is very much out of date. New install instructions can be found here: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html |
Thanks for picking up! Earlier I was chagrined to think that I had
missed a step in installing sam. I had followed the link you reference,
and today abortive installation had no influence on my problem.
You can see that problem at
https://forums.aws.amazon.com/thread.jspa?messageID=916550󟱆
…On 9/18/19 4:24 PM, Jacob Fuss wrote:
@iceback <https://github.com/iceback> We no longer support npm and is
very much out of date.
New install instructions can be found here:
https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#66>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACY7PBKPTK2LSFZUKBEWULQKKTA5ANCNFSM4DXFWMLA>.
|
Most likely a bug with
go-npm
(https://github.com/sanathkr/go-npm) because it handles the installation. But filing a Issue here nevertheless for other folks to be aware of. A fix is on the way.The text was updated successfully, but these errors were encountered: