0

I'm running Ubuntu 14.04.5 via Vagrant+Virtualbox on Windows 10. npm is working great and I haven't had any problems installing any modules. A few days ago I tried installing bcrypt but the process failed. I tried all of the solutions I could find on stackoverflow threads, and the only one that worked was installing using yarn. I won't get into it, but I prefer bcrypt to be installed via npm. Then I tried installing bcryptjs, crypto-js and jsonwebtoken, all FAIL! So for some reason all of the cryptography related modules fail when installing via npm... I tried updating node and npm to the latest version but the I wasn't able to install anything. Going back to npm v 5.7.1 got me back to where i was before: I can install everything but cryptography related modules.

The error I get trying to install bcrypt:

688 verbose stack Error: ENOENT: no such file or directory, open '/vagrant    /node/test8/node_modules/bcrypt/node_modules/minipass/node_modules/yallist/package.json.1450451485'
694 error path /vagrant/node/test8/node_modules/bcrypt/node_modules/minipass/node_modules/yallist/package.json.1450451485
695 error code ENOENT
696 error errno -2
697 error syscall open
698 error enoent ENOENT: no such file or directory, open '/vagrant/node/test8/node_modules/bcrypt/node_modules/minipass/node_modules/yallist/package.json.1450451485'
699 error enoent This is related to npm not being able to find a file.

The error(s) I get trying to install bcryptjs:

354 warn rollback Rolling back bcryptjs@2.4.3 failed (this is probably harmless): ETXTBSY: text file is busy, unlink '/vagrant/node/test8/node_modules/bcryptjs/package.json.3007922196'
360 verbose stack Error: ETXTBSY: text file is busy, rename '/vagrant/node/test8/node_modules/bcryptjs/package.json.3007922196' -> '/vagrant/node/test8/node_modules/bcryptjs/package.json'
366 error path /vagrant/node/test8/node_modules/bcryptjs/package.json.3007922196
367 error code ETXTBSY
368 error errno -26
369 error syscall rename
370 error ETXTBSY: text file is busy, rename '/vagrant/node/test8/node_modules/bcryptjs/package.json.3007922196' -> '/vagrant/node/test8/node_modules/bcryptjs/package.json'

The error(s) I get trying to install crypto-js:

359 verbose stack Error: ETXTBSY: text file is busy, rename '/vagrant/node/test8/node_modules/crypto-js/package.json.3321474119' -> '/vagrant/node/test8/node_modules/crypto-js/package.json'
365 error path /vagrant/node/test8/node_modules/crypto-js/package.json.3321474119
366 error code ETXTBSY
367 error errno -26
368 error syscall rename
369 error ETXTBSY: text file is busy, rename '/vagrant/node/test8/node_modules/crypto-js/package.json.3321474119' -> '/vagrant/node/test8/node_modules/crypto-js/package.json'

The error(s) I get trying to install jsonwebtoken:

597 verbose stack Error: ETXTBSY: text file is busy, rename '/vagrant/node/test8/node_modules/jwa/package.json.1518470635' -> '/vagrant/node/test8/node_modules/jwa/package.json'
603 error path /vagrant/node/test8/node_modules/jwa/package.json.1518470635
604 error code ETXTBSY
605 error errno -26
606 error syscall rename
607 error ETXTBSY: text file is busy, rename '/vagrant/node/test8/node_modules/jwa/package.json.1518470635' -> '/vagrant/node/test8/node_modules/jwa/package.json'

any idea what's causing all this?

Liam Arbel
  • 467
  • 1
  • 7
  • 14

1 Answers1

0

There are some cases in which NPM fails to find a file. Try the following and let me know:

  1. Run the command vagrant halt to halt the vagrant
  2. Delete the node_modules folder.
  3. Update the NPM and Node to the latest version
  4. Run npm cache clean --force
  5. Now try to install
  6. Once everything is done, you can up the vagrant by running vagrant up and if you wanted SSH, then run this command after up, vagrant ssh

More information related to the similar issues can be seen here

Might be useful for you, https://stackoverflow.com/a/47091934/2520628

Also on a side note, some modules require a different version of NPM, see here

So my guess is that you might be trying to install an incompatible version

Tejashwi Kalp Taru
  • 2,994
  • 2
  • 20
  • 35
  • Thank you Tejashwi for your quick reply. I updated node to v 10.1.0 and npm to v 6.2. Couldn't install anything again! Reverted back to npm 5.7.1 and now I can install every module but bcrypt. Will do without it I guess, bcryptjs should suffice. – Liam Arbel Jul 30 '18 at 14:00