Skip to content
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

ENOENT while installing with npm #263

Closed
hovissimo opened this issue Jan 16, 2018 · 3 comments
Closed

ENOENT while installing with npm #263

hovissimo opened this issue Jan 16, 2018 · 3 comments

Comments

@hovissimo
Copy link

I'm having trouble installing on Ubuntu 17 with npm.

npm install -g aws-sam-local (no sudo, npm's default directory is in my home folder) results in:

> aws-sam-local@0.2.4 postinstall /home/hovis/.npm-global/lib/node_modules/aws-sam-local
> go-npm install

Downloading from URL: https://github.com/awslabs/aws-sam-local/releases/download/v0.2.4/sam_0.2.4_linux_amd64.tar.gz
fs.js:811
  return binding.rename(pathModule._makeLong(oldPath),
                 ^

Error: ENOENT: no such file or directory, rename 'bin/sam' -> '/home/hovis/.npm-global/bin/sam'
    at Error (native)
    at Object.fs.renameSync (fs.js:811:18)
    at /home/hovis/.npm-global/lib/node_modules/aws-sam-local/node_modules/go-npm/bin/index.js:62:12
    at /home/hovis/.npm-global/lib/node_modules/aws-sam-local/node_modules/go-npm/bin/index.js:51:9
    at ChildProcess.exithandler (child_process.js:189:7)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:920:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
npm ERR! Linux 4.13.0-21-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "aws-sam-local"
npm ERR! node v6.11.4
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE

npm ERR! aws-sam-local@0.2.4 postinstall: `go-npm install`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the aws-sam-local@0.2.4 postinstall script 'go-npm install'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, 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 information on how to open an issue for this project with:
npm ERR!     npm bugs aws-sam-local
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls aws-sam-local
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/hovis/foo/npm-debug.log

The error was originally EACCES: permission denied, rename 'bin/sam' -> '/usr/local/bin/sam' when I issued sudo npm install -g aws-sam-local. I followed the steps at https://docs.npmjs.com/getting-started/fixing-npm-permissions and reinstalled npm using apt but that didn't change anything. After following step 2 in that document and moving npm's default directory into my home directory the error turns into ENOENT.

I was able to get up and running by installing a binary - but it looks like something might be goofy with the installer.

@stephenliberty
Copy link

Had the same problem on Windows - ended up having to downgrade npm all the way to 3.x in order to get the installer to work. Couldn't get the build-from-source working due to yet a different problem. Maybe try npm install -g npm@3.x ?

@Mulperi
Copy link

Mulperi commented Jan 22, 2018

Same issue on macOS with npm 5.5.1

@sanathkr
Copy link
Contributor

sanathkr commented Jun 1, 2018

Not relevant anymore since v0.3.0 moved to PIP

@sanathkr sanathkr closed this as completed Jun 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants