1

I tried to install gruntjs package via npm, but the command

npm install grunt --save-dev

received an error:

npm ERR! error rolling back Error: ETXTBSY, unlink   '/home/me/www/public_html/test/try/node_modules/grunt/node_modules/lodash/lodash.js'
npm ERR! error rolling back  grunt@0.4.4 { [Error: ETXTBSY, unlink '/home/me/www/public_html/test/try/node_modules/grunt/node_modules/lodash/lodash.js']
npm ERR! error rolling back   stack: 'Error: ETXTBSY, unlink \'/home/me/www/public_html/test/try/node_modules/grunt/node_modules/lodash/lodash.js\'',
npm ERR! error rolling back   errno: -26,
npm ERR! error rolling back   code: 'ETXTBSY'

Trying to install gulp led to a similar error.

All that I try on a virtual machine with Ubuntu 12, my host-system is Windows 8.

Sergey A
  • 21
  • 1
  • 3

3 Answers3

10

I was having the same issue and I`m also new to all of this, but I found somewhere else to type the following

sudo npm install grunt -g

This worked for me and hope it helps you

Another thing that might help would be to avoid symlink creations, so you would type

sudo npm install grunt -g --no-bin-link
Paulo Griiettner
  • 1,115
  • 12
  • 18
  • 1
    Thanks for your answer! Global installation works fine, but the next command "npm install" for plugins installation led the same error. I should add that this problem occurs in a directory that mounting with vboxsf-driver. In ubuntu directories everythig is working. – Sergey A May 12 '14 at 08:39
  • I`m really having no lucky at all running server and processor stuff on VM so far... I could get through many issues, but at the end, it still doesn't do what I was expecting... where I want to have my whole dev environment separated from my local machine... If I find better solution, I`ll return here and let you know what I found – Paulo Griiettner May 12 '14 at 14:53
  • 2
    Of course you also need `--no-bin-links` for plugin installation (`npm install --no-bin-links`). You need it whenever you install something inside of a vbox shared folder because it's not possible to store symlinks in those places. So generally it's not necessary to combine `-g` with `--no-bin-links`. – Robert May 15 '14 at 22:28
  • I had the same when installing Hapi into a file system on Windows 8 and Node on a Ubuntu VM. Adding --no-bin-link worked. – Adrian Lynch Aug 10 '14 at 08:29
  • --no-bin-links worked for me. Have added what i did at http://www.censore.blogspot.in/2015/04/npm-install-failing-with-erofs-in-npm.html – biplav May 07 '15 at 10:04
3

I found effective running the VM with admin rights, after reading and following this answer.

Enrico
  • 766
  • 8
  • 19
0

Oof, I too hit this error, but the solution for me was really stupid...

Have you tried turning it off and back on again?

("it" being your system)

I don't mean to be entirely facetious - I am on Linux, so I inevitably hit some weird stuff like this error. For me, the issue was due to an unrelated buffer overflow that I was unaware of (no errors to indicate a problem until I shut down my system - I hit a screen saying "Stack smashing detected"). Somehow, this buffer overflow seemed to be causing the ETXTSBY error to happen (which still makes little-to-no-sense to me). After rebooting, I was able to complete the installation process without issue.

E_net4
  • 27,810
  • 13
  • 101
  • 139