Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NPM on Cygwin: unexpected end of file

I am trying to use NPM on cygwin, but keep getting following errors:

ERR! tar "-mvxpf" "-" "--no-same-owner" "-C" "/tmp/npm-1305893882865/1305893885765-0.008730818051844835/contents/___package.npm" tar: Unexpected EOF in archive
ERR! tar "-mvxpf" "-" "--no-same-owner" "-C" "/tmp/npm-1305893882865/1305893885765-0.008730818051844835/contents/___package.npm" tar: Unexpected EOF in archive
ERR! tar "-mvxpf" "-" "--no-same-owner" "-C" "/tmp/npm-1305893882865/1305893885765-0.008730818051844835/contents/___package.npm" tar: Error is not recoverable: exiting now
ERR! tar "-mvxpf" "-" "--no-same-owner" "-C" "/tmp/npm-1305893882865/1305893885765-0.008730818051844835/contents/___package.npm" 
ERR! Failed unpacking /tmp/npm-1305893882865/1305893885765-0.008730818051844835/tmp.tgz
ERR! couldn't unpack /tmp/npm-1305893882865/1305893885765-0.008730818051844835/tmp.tgz to /tmp/npm-1305893882865/1305893885765-0.008730818051844835/contents
verbose about to build /home/Tema/node_modules/express
ERR! error installing [email protected] Error: Failed tar "-mvxpf" "-" "--no-same-owner" "-C" "/tmp/npm-1305893882865/1305893885765-0.008730818051844835/contents/___package.npm"

There are couple advices I googled (npm cache clean and rebaseall), but nothing helped. So, is there any way to use NPM in Cygwin?

like image 808
spacevillain Avatar asked May 20 '11 12:05

spacevillain


1 Answers

  1. Blow the tmp directory away

    rm -R /tmp/*
    
  2. Clear npm's cache

    npm cache clean
    
  3. Exit out of your current shell and start a ash or dash shell up (from in cygwin/bin)

  4. In the ash (or dash) shell execute the rebaseall command.

    /bin/rebaseall -v
    
  5. Exit out and restart a new bash shell.

  6. Try your npm command again.

    npm install <package>
    
like image 188
MikeyW Avatar answered Oct 24 '22 07:10

MikeyW