shireef khatab shireef khatab - 3 months ago 20
Node.js Question

Getting errors with npm when installing nativescript

i am trying to install nativescript, i am new to it so i'll appreciate any help..
first , i installed it correctly but after that i saw a page on nativescript site for advanced installation, so i played around with it .. now i cannot run the command tns and cannot uninstall, can`t install..
here is the errors i get:

first pic

second pic

note: I also updated my nodejs to the newest version , but couldnt update npm , when i tried to run: npm install npm -g i got errors like here:

npm errors

i also tried rebooting the pc but didn`t help.

i uninstalled node, npm then installed them again .. now i get this error :

ERR! network getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
ERR! network This is most likely not a problem with npm itself
ERR! network and is related to network connectivity.
ERR! network In most cases you are behind a proxy or have bad network settings.
ERR! network
ERR! network If you are behind a proxy, please make sure that the
ERR! network 'proxy' config is set properly. See: 'npm help config'

ERR! Please include the following file with any support request:
ERR! C:\Users\Home\npm-debug.log

Answer

It was a connection problem.

I remember that I played with proxy configuration like this :

   npm config set proxy http://localhost:8080/
   npm config set https-proxy http://localhost:8080/
   npm config set strict-ssl false

which made npm client attempts to hit localhost:8080 to pull the module rather than the correct internet endpoint.

so after couple of days of frustration i visited this link

https://docs.npmjs.com/cli/config

then run

npm config edit

which opened a file inside that file i removed three lines about proxy https and similar stuff , then everything worked fine