Vue.js project npm install errors - vue.js

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!

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!

Related

Not able to change npm proxy settings

I was trying to install ExpressJs from npm was using the command:
npm i express
But I got the following error:
npm ERR! Linux 4.15.0-50-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "i" "express"
npm ERR! node v8.10.0
npm ERR! npm v3.5.2
npm ERR! code ECONNRESET
npm ERR! network tunneling socket could not be established, cause=connect ETIMEDOUT 10.7.0.1:8080
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is 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! Please include the following file with any support request:
npm ERR! /home/akhil/npm-debug.log
I suspect it is a proxy error. I use previously working under proxy (mentioned in the error 10.7.0.1:8080) but now I didn't want the proxy and was trying to remove it, for the I have tried the commands:
npm config rm proxy
npm config rm https-proxy
I have also tried adding -g to the above commands
Also I have used,
set HTTP_PROXY=null
set HTTPS_PROXY=null
When I use the command
npm config ls -l
It shows both proxy and https-proxy equal to null. But it seems the proxy has not actually changed looking at the error.
Any help on how to deal with this error would be appreciated.
First, set your proxy false
npm config set proxy false
After that clean your cache
npm cache clean
If that didn't help you and you are using proxy then try this:
npm config set proxy http://proxyhost:proxyport
npm config set https-proxy http://proxyhost:proxyport

I can't install any npm package

I keep getting this error every time I try to install npm package :
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npmjs.org/json-server failed, reason: getaddrinfo ENOTFOUND proxy.company.com proxy.company.com:8181
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! ```
Seems you've misconfigured your proxy infos, here's how to configure it for npm from your cli :
npm config set proxy http://{user}:{password}#{proxy-url}:{proxy-port}
npm config set https-proxy http://{user}:{password}#{proxy-url}:{proxy-port}
and if you're not behind a proxy :
npm config delete proxy
npm config delete https-proxy
hope it can help.

Npm throws 'must have a URL that starts with http: or https:' when installing #angular2-material packages

I'm installing #angular2-material/core ( or any other module ) with npm wont let me install any of the modules.
npm ERR! Darwin 15.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "#angular2-material/core"
npm ERR! node v5.11.1
npm ERR! npm v3.8.6
npm ERR! must have a URL that starts with http: or https:
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
I've tried :
npm set registry https://registry.npmjs.org/ // https
OR
npm set registry http://registry.npmjs.org/ // http
But It wont work , I raised the issue with material guys but they're saying this is my local issue .
This is really killing me , there is no clue how to fix it at all.
https://github.com/angular/material2/issues/720
This is mainly because you've tried multiple registries and now npm is kind of confused , You need to open your .npmrc and remove unnecessary registry paths.
To find your .npmrc :
npm config ls -l | grep config
You will see something like :
userconfig /Users/Yourname/.npmrc
Then open that file with your editor and edit and remove extra unnecessary registries .

Error with NPM install - code ENOTFOUND

I am trying to run 'npm install' for my homework assignment - which has the package.json file given to me already but I keep on getting the following error:
Ramons-MacBook-Pro-3:project4 sacrams14$ npm install
npm WARN package.json project4#1.0.0 No repository field.
npm WARN package.json project4#1.0.0 No README data
npm ERR! Darwin 14.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v4.2.6
npm ERR! npm v2.14.12
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! syscall getaddrinfo
npm ERR! network getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:80
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is 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! Please include the following file with any support request:
npm ERR! /Users/sacrams14/Dropbox/CS 142/project4/npm-debug.log
It really seems that there is problem with your internet connection.
Please check internet connectivity (seems to work beacause you were able to write here ;)).
Check current version of npm and your installed version. Maybe old version is not able to contact with server.
Check out if your firewall allows npm to contact with the internet.

npm install -g ionic not working on windows 7 even I am not on proxy

I am kinda stuck here, npm install -g ionic not working on my home computer which is windows 7 and i dont have any proxy. i am able to download other packages like npm install -g gulp etc.
Already tried changing as suggested by other guys on stackoverflow here
npm config set registry http://registry.npmjs.org/
I am getting bellow error
npm ERR! network read ECONNRESET
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settin
gs.
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! Windows_NT 6.1.7600
npm ERR! argv "C:\\node\\\\node.exe" "C:\\node\\node_modules\\npm\\bin\\npm-cli.
js" "install" "ionic"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! code ECONNRESET
npm ERR! errno ECONNRESET
npm ERR! syscall read
Try to clear cache first:
npm cache clean
and then Try to install again
npm install -g ionic