• Reinstalled node-gyp, npm and nodejs.
sudo apt-get remove nodejs npm
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -y nodejs

git clone --depth=1 git://github.com/npm/cli.git
cd cli/scripts
chmod +x install.sh
sudo ./install.sh

npm install node-gyp
Copy the code
  • Restarted computer and shell.
  • Replaced the installation of graceful-fs.
sudo npm install --force -g graceful-fs
Copy the code