ETXTBSY: text file is busy

What I Wanted to Do

I wanted to run npm install and have my packages installed on my Virtualbox managed Vagrant setup with Windows 10 as host OS.

The package.json file looks like this:

{
  "dependencies": {
    "babel-polyfill": "^6.26.0",
    "jquery": "^3.2.0",
    "lightbox2": "^2.9.0",
    "semantic-ui-css": "^2.2.0"
  },
  "devDependencies": {
    "babel-core": "^6.26.3",
    "babel-plugin-external-helpers": "^6.22.0",
    "babel-plugin-module-resolver": "^3.1.1",
    "babel-plugin-transform-object-rest-spread": "^6.26.0",
    "babel-preset-env": "^1.7.0",
    "babel-register": "^6.26.0",
    "dedent": "^0.7.0",
    "eslint": "^4.19.1",
    "eslint-config-airbnb-base": "^12.1.0",
    "eslint-import-resolver-babel-module": "^4.0.0",
    "eslint-plugin-import": "^2.12.0",
    "fast-async": "^6.3.7",
    "gulp": "^4.0.0",
    "gulp-chug": "^0.5",
    "gulp-concat": "^2.6.0",
    "gulp-debug": "^2.1.2",
    "gulp-if": "^2.0.0",
    "gulp-livereload": "^3.8.1",
    "gulp-order": "^1.1.1",
    "gulp-sass": "^4.0.1",
    "gulp-sourcemaps": "^1.6.0",
    "gulp-uglifycss": "^1.0.5",
    "merge-stream": "^1.0.0",
    "rollup": "^0.60.7",
    "rollup-plugin-babel": "^3.0.4",
    "rollup-plugin-commonjs": "^9.1.3",
    "rollup-plugin-inject": "^2.0.0",
    "rollup-plugin-node-resolve": "^3.3.0",
    "rollup-plugin-uglify": "^4.0.0",
    "upath": "^1.1.0",
    "yargs": "^6.4.0"
  },
  "scripts": {
    "build": "gulp build",
    "gulp": "gulp build",
    "lint": "yarn lint:js",
    "lint:js": "eslint gulpfile.babel.js",
    "watch": "gulp watch"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/Sylius/Sylius.git"
  },
  "author": "Paweł Jędrzejewski",
  "license": "MIT"
}

What Happened Instead

Instead of successfully installing the packages, I am presented with the following error message:

npm ERR! path /home/vagrant/code/yo3/node_modules/alphanum-sort/package.json.548391976
npm ERR! code ETXTBSY
npm ERR! errno -26
npm ERR! syscall rename
npm ERR! ETXTBSY: text file is busy, rename '/home/vagrant/code/yo3/node_modules/alphanum-sort/package.json.548391976' -> '/home/vagrant/code/yo3/node_modules/alphanum-sort/package.json'

Reproduction Steps

Initiate a vagrant file:

vagrant init bento/ubuntu18-04
vagrant up
vagrant ssh

$ wget -qO- https://deb.nodesource.com/setup_10.x | sudo -E bash -
$ sudo apt-get install -y nodejs
$ cd /vagrant
$ npm install

Details

This is a recreation of https://github.com/npm/npm/issues/20605

Temporary solution is to downgrade to NPM 5.1.7

Platform Info

Windows 10
Vagrant 2.1.5
Virtualbox 5.2.18

$ npm --versions
{ npm: '6.4.1',
  ares: '1.14.0',
  cldr: '33.1',
  http_parser: '2.8.0',
  icu: '62.1',
  modules: '64',
  napi: '3',
  nghttp2: '1.34.0',
  node: '10.12.0',
  openssl: '1.1.0i',
  tz: '2018e',
  unicode: '11.0',
  uv: '1.23.2',
  v8: '6.8.275.32-node.35',
  zlib: '1.2.11' }
$ node -p process.platform
linux

Same issue I was having ( and issue still exist ):

a related topic:
https://github.com/npm/npm/issues/992

Same issue here,

Workarounds rated from easiest/suitable to worst, in my opinion:
1 - Downgrade npm version to 5.7.1 .
2 - Use Yarn instead of npm.
3 - Install node.js on the host ( windows 10 ) and do npm install from the host.
4 - Use SMB or NFS file mounting instead in vagrant, but these come with their own issues…

Definitely would like a fix from NPM’s side instead of doing any of these workarounds.

Is there any update on this from NPM’s side? This has broken countless production projects for me, and it’s something that happened recently in the underlying Windows / Vagrant / VBox plumbing - it’s not my code, because my project setup worked for ages without error.

Right now I’m forced to rework a ton of systems to use Yarn instead of NPM, which is pretty sad because yet again Yarn comes through in a pinch.

Same issue using docker container over docker-toolbox for windows
I tried to use npm with these images:

  • node:lts
  • node:latest

Workaround: I used yarn to install package :(

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.