sudo npm install fails
See original GitHub issueMost 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.
sudo npm install -g aws-sam-local
Password:
-
> aws-sam-local@0.1.1 postinstall /Users/sanathkr/.nvm/versions/node/v4.3.0/lib/node_modules/aws-sam-local
> go-npm install
Downloading from URL: https://github.com/awslabs/aws-sam-local/releases/download/v0.1.1/sam_0.1.1_darwin_amd64.tar.gz
fs.js:681
return binding.rename(pathModule._makeLong(oldPath),
^
Error: EACCES: permission denied, rename 'bin/sam' -> '/Users/sanathkr/.nvm/versions/node/v4.3.0/bin/sam'
at Error (native)
at Object.fs.renameSync (fs.js:681:18)
at /Users/sanathkr/.nvm/versions/node/v4.3.0/lib/node_modules/aws-sam-local/node_modules/go-npm/bin/index.js:62:12
at /Users/sanathkr/.nvm/versions/node/v4.3.0/lib/node_modules/aws-sam-local/node_modules/go-npm/bin/index.js:51:9
at ChildProcess.exithandler (child_process.js:204:7)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:821:16)
at Socket.<anonymous> (internal/child_process.js:319:11)
at emitOne (events.js:77:13)
npm ERR! Darwin 16.6.0
npm ERR! argv "/Users/sanathkr/.nvm/versions/node/v4.3.0/bin/node" "/Users/sanathkr/.nvm/versions/node/v4.3.0/bin/npm" "install" "-g" "aws-sam-local"
npm ERR! node v4.3.0
npm ERR! npm v2.14.12
npm ERR! code ELIFECYCLE
npm ERR! aws-sam-local@0.1.1 postinstall: `go-npm install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the aws-sam-local@0.1.1 postinstall script 'go-npm install'.
npm ERR! This is most likely a problem with the aws-sam-local package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! go-npm install
npm ERR! You can get their info via:
npm ERR! npm owner ls aws-sam-local
npm ERR! There is likely additional logging output above.
> aws-sam-local@0.1.1 preuninstall /Users/sanathkr/.nvm/versions/node/v4.3.0/lib/node_modules/aws-sam-local
> go-npm uninstall
npm ERR! Please include the following file with any support request:
npm ERR! /Users/sanathkr/workspace/GoWorkspace/src/github.com/awslabs/aws-sam-local/npm-debug.log
Issue Analytics
- State:
- Created 6 years ago
- Comments:37 (9 by maintainers)
Top Results From Across the Web
How to fix npm throwing error without sudo - Stack Overflow
Solution 2: Install packages globally for a given user · 2. If node is installed by sources, although multiuser would be a problem,...
Read more >Don't use `sudo` with `npm`. Running sudo npm install - Medium
Using sudo npm install (and potentially sudo npm <anything> ) is a bad idea ™. This is an issue for at least a...
Read more >Resolving EACCES permissions errors when installing ...
This is the best way to avoid permissions issues. To reinstall npm with a node version manager, follow the steps in "Downloading and...
Read more >NPM install error - Material Design for Bootstrap
Trying to install MDB pro 4.19.2 just downloaded and ran npm install but getting this error of sha512 not matching. Can someone tell...
Read more >Don't use "sudo" with NPM "install" - DEV Community
Using "sudo" when installing NPM packages may put your computer at risk, by giving untrusted code administrative privileges. Please do not use " ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Following fixed for me
npm config set unsafe-perm=true
(Option 1 from that document should fix most ppl’s permissions issues)