10

Installing Grunt as in the Bootstrap documentation shown, I first installed grunt-cli globally with npm install -g grunt-cli and now I'm trying to execute npm install, but only getting errors:

root@devvm:/var/www/axit/portfolio/public/bower_components/bootstrap# npm install
npm ERR! tar.unpack untar error /root/.npm/wrappy/1.0.1/package.tgz
npm ERR! tar.unpack untar error /root/.npm/wrappy/1.0.1/package.tgz
npm ERR! tar.unpack untar error /root/.npm/brace-expansion/1.1.0/package.tgz
npm ERR! tar.unpack untar error /root/.npm/delayed-stream/0.0.5/package.tgz
npm WARN optional dep failed, continuing form-data@0.1.4
npm ERR! tar.unpack untar error /root/.npm/is-property/1.0.2/package.tgz
npm WARN optional dep failed, continuing request@2.54.0
npm ERR! Linux 3.2.0-4-amd64
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.10.35
npm ERR! npm  v2.7.4
npm ERR! path /var/www/axit/portfolio/public/bower_components/bootstrap/node_modules/grunt-saucelabs/node_modules/sauce-tunnel/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js
npm ERR! code EPERM
npm ERR! errno 50

npm ERR! Error: EPERM, open '/var/www/axit/portfolio/public/bower_components/bootstrap/node_modules/grunt-saucelabs/node_modules/sauce-tunnel/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js'
npm ERR!  { [Error: EPERM, open '/var/www/axit/portfolio/public/bower_components/bootstrap/node_modules/grunt-saucelabs/node_modules/sauce-tunnel/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js']
npm ERR!   errno: 50,
npm ERR!   code: 'EPERM',
npm ERR!   path: '/var/www/axit/portfolio/public/bower_components/bootstrap/node_modules/grunt-saucelabs/node_modules/sauce-tunnel/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Linux 3.2.0-4-amd64
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.10.35
npm ERR! npm  v2.7.4
npm ERR! path npm-debug.log.ba707f2a7a688e388708bbe88e2dd4ed
npm ERR! code ETXTBSY
npm ERR! errno 62

npm ERR! ETXTBSY, rename 'npm-debug.log.ba707f2a7a688e388708bbe88e2dd4ed'
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /var/www/axit/portfolio/public/bower_components/bootstrap/npm-debug.log

I've just copied the project in a non-shared folder and started npm install again. And it worked. So, it seems to be a shared folder issue. But what exactly? Symlinks are enabled for this shared folder and I started the VM as admin (it helped, when I had similar issues installing Bower).

What is causing these errors and how to solve this problem?

Environment: VirtualBox with Debian guest system and Windows 7 host system.

EDIT

Now (I think after I've successfully executed npm install in a non-shared folder) I'm geting different errors:

When I start the VM in the common way:

root@devvm:/var/www/axit/portfolio/public/bower_components/bootstrap# npm install
npm ERR! tar.unpack untar error /root/.npm/delayed-stream/0.0.5/package.tgz
npm WARN optional dep failed, continuing form-data@0.1.4
npm ERR! tar.unpack untar error /root/.npm/wrappy/1.0.1/package.tgz
npm ERR! tar.unpack untar error /root/.npm/wrappy/1.0.1/package.tgz
npm ERR! tar.unpack untar error /root/.npm/brace-expansion/1.1.0/package.tgz
npm ERR! Linux 3.2.0-4-amd64
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.10.35
npm ERR! npm  v2.7.4
npm ERR! path ../semver/bin/semver
npm ERR! code UNKNOWN
npm ERR! errno -1

npm ERR! UNKNOWN, symlink '../semver/bin/semver'
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Linux 3.2.0-4-amd64
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.10.35
npm ERR! npm  v2.7.4
npm ERR! path npm-debug.log.428531818e2d916d5ae79bdf94dd73b3
npm ERR! code ETXTBSY
npm ERR! errno 62

npm ERR! ETXTBSY, rename 'npm-debug.log.428531818e2d916d5ae79bdf94dd73b3'
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /var/www/axit/portfolio/public/bower_components/bootstrap/npm-debug.log

When I start the VM as Administrator:

root@devvm:/var/www/axit/portfolio/public/bower_components/bootstrap# npm install
npm ERR! tar.unpack untar error /root/.npm/wrappy/1.0.1/package.tgz
npm ERR! tar.unpack untar error /root/.npm/wrappy/1.0.1/package.tgz
npm ERR! tar.unpack untar error /root/.npm/delayed-stream/0.0.5/package.tgz
npm ERR! tar.unpack untar error /root/.npm/brace-expansion/1.1.0/package.tgz
npm WARN optional dep failed, continuing form-data@0.1.4
npm ERR! Linux 3.2.0-4-amd64
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.10.35
npm ERR! npm  v2.7.4
npm ERR! path /var/www/axit/portfolio/public/bower_components/bootstrap/node_modules/grunt-contrib-qunit/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/fs-extra/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy
npm ERR! code UNKNOWN
npm ERR! errno -1

npm ERR! UNKNOWN, mkdir '/var/www/axit/portfolio/public/bower_components/bootstrap/node_modules/grunt-contrib-qunit/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/fs-extra/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy'
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Linux 3.2.0-4-amd64
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.10.35
npm ERR! npm  v2.7.4
npm ERR! path npm-debug.log.0bb66467f3aae813a34e03a797f8da19
npm ERR! code ETXTBSY
npm ERR! errno 62

npm ERR! ETXTBSY, rename 'npm-debug.log.0bb66467f3aae813a34e03a797f8da19'
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /var/www/axit/portfolio/public/bower_components/bootstrap/npm-debug.log
automatix
  • 14,018
  • 26
  • 105
  • 230
  • 1
    I didn't try to replicate your issue yet, but first I would like to ask you a question: Have you tried to run the command using `sudo`? Because this line `npm ERR! Please try running this command again as root/Administrator.` seems to suggest that. Something like `sudo npm install` maybe is the solution. – help_asap Apr 01 '15 at 08:22
  • I am `root` on the Debian guest system. And I've also started the VM as `Administrator` on the host. – automatix Apr 01 '15 at 08:26
  • Not sure, but in [this answer](http://stackoverflow.com/a/23526288/4594377) and the comments below, they suggest to use an additional option `--no-bin-link`. You said that you've had problem when installing Bower, maybe just enabling the symlinks wasn't enough. – help_asap Apr 01 '15 at 08:43
  • Just tried it out. No, it hasn't worked. – automatix Apr 02 '15 at 00:26

7 Answers7

10

Ok I see the solution

 sudo npm cache clean

Then

sudo npm install -g grunt grunt-cli

I did this on MacOS

Bob Small
  • 113
  • 1
  • 10
  • Thanks for the tips. For me, I have to invoke the command with a `-f` option : `npm cache clean -f` – itminus Feb 14 '20 at 09:27
5

Make sure your hard drive is not full. That was my case.

AlonL
  • 6,100
  • 3
  • 33
  • 32
4

Try doing sudo npm cache clean. But It looks the problem is the path is too long for windows (260byte limit) so you can't share the directory.

I tried using fenestrate but it didn't work out for me. You may also want to check this entry.

estani
  • 24,254
  • 2
  • 93
  • 76
  • Thank you for your answer. After a lot of attempts it finally worked. Somehow... I don't remember anymore, I think, I used a workaround, but don't remember, what it exactly was. Anyway, if I have this issue again, I will try your solution out and give a feedback. – automatix Apr 24 '15 at 11:40
1

I had a similar error and the following did not immediately resolve the issue:

npm cache clean
rm -rf node_modules
npm install

It turns out I had run out of disk space on my virtual machine. After allocating some more space and running above commands everything worked as expected.

cbaigorri
  • 2,467
  • 25
  • 26
0

I am facing the same problem and I tried all the options suggested here without succcess. Finally, I read somewhere that, I should have superuser permissions, so I did

 sudo -s 

and it seems to have resolved the problem.

ArrowHead
  • 609
  • 5
  • 16
  • Probably better to change the permissions on the folder to be owned by your user rather than using sudo. Sudo is less safe and overall not recommended (as it has super user status) – James Murphy Nov 15 '18 at 15:45
0

To me npm cache clean didn't work. However removing the problematic directory (npm remove) and then simply reinstalling the package did!

dragonmnl
  • 14,578
  • 33
  • 84
  • 129
0

In my case I tried install modules inside vagrant, nothing above didn't work, so I tried install it on host (OSX) and it worked.

MingalevME
  • 1,827
  • 1
  • 22
  • 19