Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
277 views
in Technique[技术] by (71.8m points)

javascript - error "ETXTBSY: text file is busy" on npm install

When running npm install [any package] or even npm install on homestead I get the following error:

npm ERR! ETXTBSY: text file is busy, rmdir '/home/vagrant/valemus-shop-starter/valemus-shop/node_modules/fsevents'

Debug log can be seen here

  • Box 'laravel/homestead' (v3.0.0)
  • Node: v8.2.1
  • NPM: 5.3.0

I tried removing the fsevents directory, however, it doesn't exist.

How do I fix this?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I ran into the same thing on Windows 10 + VirtualBox (VBox) + Vagrant + Laravel Homestead when I wanted to change to react frontend.

And after much search and trial and error, this solution worked for me, maybe it works for you as well.

Halted the vagrant:

vagrant halt

Added the following into the configure section of the Vagrantfile in the Homestead dir

  config.vm.provider "virtualbox" do |v|
        v.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"]
  end

started the cmd as admin

then vagrant up

and vagrant ssh

cd to development dir

then removed the node_modules dir by rm -rf node_modules/ if any

and then ran the sudo npm install && npm run dev

and the whole thing was installed without any warnings or errors.

This is the result of two hours reading :)

Edit:

If your problem is not solved and you have the mentioned setup you can use another solution:

Install the Node on your windows machine too

Then cd to your development directory and run the npm install from the Windows and the you'll have the same result.

You can also initiate the npm run watch from a windows cmd afterwards.

This helped me to lift the load from the VM and let the Windows do the watch and receive the notifications of the npm run watch in Windows.

Cheers


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...