saleor: NPM Install Fails on Ubuntu 18.04 - ENOENT: no such file or directory, rename /node_modules/@babel/.plugin-syntax-jsx.DELETE/node_modules/@babel

What I’m trying to achieve

I’m following the installation instructions in the documentation. When I get to npm install it fails every time with this error:

npm ERR! path /vagrant/node_modules/@babel/.plugin-transform-react-display-name.DELETE/node_modules/@babel
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/vagrant/node_modules/@babel/.plugin-transform-react-display-name.DELETE/node_modules/@babel' -> '/vagrant/node_modules/@babel/plugin-transform-react-display-name/node_modules/@babel'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/vagrant/.npm/_logs/2019-06-22T22_47_41_028Z-debug.log

Steps to reproduce the problem

  1. Fresh install of Ubuntu 18.04 (I’m using vagrant with the bento/ubuntu-18.04 box, and VMware)
  2. Install all dependencies according to the docs including an up to date version of Node
  3. run npm install and the error happens.

Node Version: v10.16.0

npm version: 6.9.0

I’ve already tried:

  1. Deleting my node_modules and rerunning npm install
  2. Using yarn to install (This successfully installs all the packages, but then trying to build the assets is failing. I also read yarn is not supported, so I don’t think this is a good route anyways)
  3. Using a different vagrant box generic/ubuntu1804
  4. running sudo npm install -g npm (I had read in a different thread this can shake things loose, but it didn’t work for me)

What I expected to happen

Installing the npm packages

System information Operating system: Ubuntu 18.04 (Virtualized through VMWare and Vagrant) Browser: Chrome Node: 10.16.0 Npm: 6.9.0

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 20 (9 by maintainers)

Most upvoted comments

So the issue is caused by the filesystem at /vagrant, do you really need to use a shared filesystem? You could use a ext4 filesystem in your VM instance and maybe creating a link in /vagrant to you saleor project would allow you to access your files from your PC or whatever you are using the shared filesystem for? Note that your home and / are in ext4.

By googling I found someone that had the same idea: https://github.com/Hashnode/mern-starter/issues/185#issuecomment-238080329

I also found someone that said it was their antivirus (malwarebyte in their case) that was deleting files before npm was able to process them. You could also check if any of your antivirus(es) have deleted or quarantined files–the easiest might be to disable any protection and see if that works on /vagrant.

But I never heard anyone having issues with their antivirus for installing the dependencies, so I would be doubtful. But that’s always good to give it a try.

Hmm thats a bummer, but makes sense. I can give that a go since now we know it’s the shared filesystem causing all the problems.

The node_modules folder does not need to live on the shared filesystem. Thanks for your help on this!