B
B
baretsky2018-04-28 08:25:03
npm
baretsky, 2018-04-28 08:25:03

NPM: text file is busy?

I am using Laravel Homestead. Downloaded VirtualBox, Vagrant. Successfully installed and configured. As soon as I started adding dependencies to package.json, the error started

ETXTBSY: text file is busy, rename ...

In general, this file is already occupied by some program and NPM cannot edit package.json. I tried many ways: I ran it from under the admin, which options I tried, nothing helps.
I use Windows 10, NPM 6. Windows is new, I just installed it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2018-04-28
@alexey-m-ukolov

Most likely, one of the following solutions will suit you: https://github.com/npm/npm/issues/9979
Most likely, this one :
since i had to further install bower, so i used:
Then i wanted to build my wordpress sage template. I used

$ gulp <---- further gave some error and pointed me to use "npm rebuild node-sass"

$ npm rebuild node-sass <- gave again some symbolic link error, I choose below

command which worked fine.
Further i was able to use gulp to build.
And here is a detailed description of the causes of the problem:
My guess is that you're both running Linux inside Vagrant on a Windows host, because ETXTBSY is almost always due to Windows not wanting to let the guest OS remove or move a file. Generally, this happens when you have a cmd.exe process open in a directory, or are looking at the folder with Explorer, or have a file in there open in a text editor.
@Stanzilla, if you delete your current node_modules folder and reinstall, it will go from being the deeply nested [email protected]<3 style tree to the new [email protected] maximally flat tree, which should fix the original problem you were seeing.
@samir1kumar, it looks like you want to run your install with --no-bin-links, because you don't have your Vagrant shared directory configured to support symlinks (this is possible, but not done by default by VirtualBox or Vagrant because security concerns). This also means you can't use linked modules in your shared directory. I shared some more thoughts about this on Twitter. Vagrant with shared directories seems like it should be the best of both worlds, but there are a surprising number of pitfalls to making it work without issues.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question