error “ETXTBSY: text file is busy” on npm install

后端 未结 9 2183
谎友^
谎友^ 2020-12-09 08:16

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

npm ERR! ETXTBSY: text file is b         


        
9条回答
  •  隐瞒了意图╮
    2020-12-09 08:45

    I was still getting an error, even after doing following

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

    as suggested by Babak Bandpey

    It turned out that there was another annoying problem of file path character limit. This happens quite often if you are using a node module with long name. You can easily solve this by following these steps after vagrant ssh into linux vm:

    1. Create ‘node_modules’ folder in your home folder mkdir ~/node_modules

    2. Add symbolic link to the ‘node_modules’ folder you just created inside your project folder

      ln -sf ~/node_modules /vagrant/your-project-folder

    This solution will ensure that all the node modules are stored inside home directory instead of synced folder. Original source : https://blog.rudylee.com/2014/10/27/symbolic-links-with-vagrant-windows/

    Hope it helps somone having similar issue, thanks!

提交回复
热议问题