[LINUX] What to do if ENOENT: no such file or directory appears during npm install

Introduction

One day suddenly I couldn't do npm install. (Correctly, an error will occur at runtime.)

$ npm install -g @aws-amplify/cli
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /home/vagrant/.npm/_cacache/tmp/823188c5
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/home/vagrant/.npm/_cacache/tmp/823188c5'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

This article describes what to do if the cache folder cannot be referenced with this errno -2.

Coping (conclusion)

$ unlink /home/vagrant/.npm

Cause

If you look at the coping command, you may not need to explain it, but for the time being. The npm cache destination path that was output at the time of the error was a symbolic link. I don't remember when the symbolic link was created. .. ..

Recommended Posts

What to do if ENOENT: no such file or directory appears during npm install
What to do when [Errno 2] No such file or directory appears in Python
EC2 / Amazon Linux2: What to do if you get an "unable to execute'gcc': No such file or directory" error with pip install
pip install --upgrade pip will result in No such file or directory
What to do if No Python documentation found for ... appears in pydoc
NO MORE “cd: foo: No such file or directory”
Note: What to do if pip install fails
What to do if "amazon-linux-extras" → "No module named amazon_linux_extras"
A story about what to do when a bad interpreter: Not such file or directory appears in Anaconda3 and how to investigate the cause.
What to do if pip install fails in Xcode 5.1
[Go 1.13] What to do when unexpected directory layout: appears
What to do if you can't pip install mysqlclient
No module named What to do if you get'libs.resources'
ModuleNotFoundError: No module What to do if you get'tensorflow.contrib'
What to do if pip install fails to install dependent libraries
What to do if `pip install matplotlib` fails on Mac
What to do if Linux VLC can no longer rotate
What to do if pip install mysqlclient fails on MacOS
What to do if you cat or tail a binary file and the terminal is garbled
What to do if yum breaks
What to do with Magics install
What to do if you can't install pyaudio with pip #Python
What to do if python says "fatal error:'stdio.h' file not found"
When I try to run the pip command after updating pip, I get "No such file or directory"
What to do if you get a UnicodeDecodeError with pip install
What to do if Insecure Platform Warning appears when running Python
-bash: ./ {file name} .sh: /usr/bin/bash: bad interpreter: No such file or directory
No such file or directory:'chromedriver': Resolve'chromedriver'
What to do if grep: empty (sub) expression appears on Mac grep
[Note] How to deal with unicode error and No such file or directory (output table to excel file with pandas)
What to do if you can't find PDO in Laravel or CakePHP
Import Error: libffi.so.6: cannot open shared object file: No such file or directory
What to do if you get lost in file reference with FileNotFoundError
What to do if you get stuck during Anaconda installation on Linux
What to do if pyenv install does not proceed with an error
What to do if you can't install with pip in babun environment
Cannot import cv2 (libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory)
Addressed "Python .h: No such file or directory" when installing uWSGI with Python 3.8
When bus = smbus.SMBus (1) gets IOError: [Errno 2] No such file or directory when trying to start the GrovePi starter kit
Notes on what to do if "macOS 11 or later required!" Appears in Big Sur or pyarrow2.0.0 cannot be installed
What to do if you get a "No versions found" error in pipenv
What to do when xlrd.biffh.XLRDError: Unsupported format, or corrupt file: Expected BOF record;
What to do if NotADirectoryError: [Errno 20] Not a directory:'xdg-settings' appears in jupyter notebook
What to do if you can't pipenv shell
What to do if mod_fcgid cannot resolve UnicodeEncodeError
What to do if rails s doesn't work
What to do if pip cannot be installed
What to do if atom autocomplete-python doesn't work
What to do if Docker-sync suddenly stops working
What to do if your Jupyter Notebook for beginners asks for a password or token
What to do if you get `No kernel for language python found` in Hydrogen
[Python] What to do when No module named'pyproj.datadir' appears when Exe is done with PyInstaller
How to install and use pyenv, what to do if you can't switch python versions
What to do if you get an error when vagrant up when you enable public_network or private_network on Vagrant + Arch Linux → Install netctl
[openpyxl] What to do when IllegalCharacterError appears in pandas.DataFrame.to_excel
What to do if SciPy installation fails on CentOS
What to do when gdal_merge creates a huge file
What to do if a UnicodeDecodeError occurs in pip
pipenv shell is no longer available ... what to do?
What to do if sys / cdefs.h does not exist
What to do if pyenv is not enabled (zsh)