“Error: ETXTBSY” when installing the package with

2019-06-03 17:14发布

问题:

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.

回答1:

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


回答2:

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



标签: gruntjs npm