I had multiple errors showing like the following:
npm ERR! code ERR_SOCKET_TIMEOUT
npm ERR! network Socket timeout
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-09-28T23_48_25_332Z-debug.log
npm WARN old lockfile errno: -2,
npm WARN old lockfile code: 'ENOENT',
npm WARN old lockfile syscall: 'open',
npm WARN old lockfile path: '/home/./PhpstormProjects/vue-paper-dashboard-master/node_modules/postcss/node_modules/supports-color/package.json
I thought it was my internet connection but it turned out not to be like so. I'm newbie to Vue.js so I was a little bit confused but I found my solution!
CodePudding user response:
First I added these two values to ~/.npmrc
:
timeout=60000
prefer-offline=true
then I have used the following command with deleting the node_modules
folder:
npm cache clear --force
Then I added .npmignore
to the root of my project
After that, I used
npm config set registry http://registry.npmjs.org/
but when I installed it with npm I checked as root like so :
sudo npm update
and it worked!