npm install not installing packages - javascript

I've tried to get packages to install by running npm install discord.js for example and it doesn't install it. Below is the terminal.
npm ERR! code ECONNRESET
npm ERR! syscall read
npm ERR! errno ECONNRESET
npm ERR! network request to https://registry.npmjs.org/discord.js/-/discord.js-13.1.0.tgz failed, reason: read ECONNRESET
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:
This is after a 5-10 minute wait period.
I've done almost everything imaginable. Any help would be appreciated.
Thanks!
XRift_0
Edit
After disabling Kaspersky, it worked. How do I make it work with Kaspersky enabled?

Its trying to use the proxy config set in your PC.
Check the .npmrc file available at C:\Users\yourprofile.npmrc.
Add or remove the proxy config accordingly or delete the .npmrc
proxy=http://proxyserveripordn:proxyport/
https-proxy=http://proxyserveripordns:proxyport
http-proxy=http://proxyusername:proxyuserpassword#proxyserveripordns:proxyport
strict-ssl=false

Try:
npm config set registry http://registry.npmjs.org/
So that npm requests for http url instead of https.
and after this, try the same npm install discord.js command.

This version has been deprecated , now this is no longer in npm

Related

React Installation problem npx-create-react-app not working properly

This is the error that Im facing every-time i do npx create-react-app app-name.
At first It was all good everything was working perfectly but all of a sudden it's been a few days since Im facing this error and i cant seem to solve it.
hassan_xiddiqui#Kratos:~/React$ npx create-react-app starter_1
Need to install the following packages:
create-react-app
Ok to proceed? (y) y
Creating a new React app in /home/hassan_xiddiqui/React/starter_1.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npm ERR! code ECONNRESET
npm ERR! errno ECONNRESET
npm ERR! network Invalid response body while trying to fetch https://registry.npmjs.org/eslint-plugin-jsx-a11y: aborted
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! /home/hassan_xiddiqui/.npm/_logs/2021-04-03T12_14_14_243Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.
Deleting generated file... package.json
Deleting starter_1/ from /home/hassan_xiddiqui/React
Done.
The error is very clear in the message you're receiving:
This is a problem related to network connectivity.
In most cases you are behind a proxy or have bad network settings.
If you are behind a proxy, please make sure that the
'proxy' config is set properly. See: 'npm help config'
If you're using a VPS, disable it. Try checking your DNS settings, maybe change them to Google's.
Also, try to install anything from NPM to confirm this is an issue with your connection. npm install -g create-react-app. If this (or any other package) succeeds, it may be other issue.
Consider as well it could be an issue with npx on your machine. Try installing it using create-react-app directly instead by first installing it globally (like I showed above)
It's more of an network error you can check the config or try to flush your dns or something. Maybe try some other network if possible
Try to install npm again using: npm install
Also check what node version you're using: node --v
Then, run the command again: npx create-react-app app_name

Issues setting up react

I am having issues setting up react even though I have both node and npm installed.
Typing in:
npx create-react-app new-test-react --use-npm
Results in the following error:
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npmjs.org/#babel%2fhelper-plugin-utils failed, reason: getaddrinfo ENOTFOUND your_proxy_ip
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! C:\Users\abhin\AppData\Roaming\npm-cache\_logs\2021-02-03T06_40_10_273Z-debug.log
Any help will be appreciated. Thanks alot
Looks like you are behind some proxy thats why you were not able to remote registry. The error clearly says so.
network request to https://registry.npmjs.org/#babel%2fhelper-plugin-utils failed, reason: getaddrinfo ENOTFOUND your_proxy_ip
Set the proxy config properly with these commands
$ npm config set proxy http://<username>:<password>#<proxy-server-url>:<port>
$ npm config set https-proxy http://<username>:<password>#<proxy-server-url>:<port>
More info - https://forum.freecodecamp.org/t/how-to-run-npm-behind-a-proxy-server-a-step-by-step-guide/19386

npx create-react-app my-app ERORR: rollbackFailedOptional

The command create-react-app my-app worked fine for the last week that I have been using it and now it is returning the error "rollbackFailedOptional: verb npm-session 895a42364389108b".
I already tried
npm config rm proxy
npm config rm https-proxy
npm config set registry http://registry.npmjs.org/
I am still getting the same error.
Edit:
after letting it fail completely it says the following:
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to http://registry.npmjs.org/create-react-app failed, reason: getaddrinfo ENOTFOUND domain
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! C:\Users\caleb\AppData\Roaming\npm-cache\_logs\2020-06-05T19_30_34_621Z-debug.log
I figured it out. I did
npm config get proxy
it returned null
So I had to go to "C:\Users\Myname.npmrc", open it in a notepad and then delete whats in there and add
proxy=http://yourorganizationproxy.com:8080
https-proxy=http://yourorganizationproxy.com:8080
As Caleb indicates you should go to "C:\Users\<user>" and check for .npmrc file, then edit with any notepad app. Then you should
Delete everything
Add:
proxy=http://yourorganizationproxy.com:8080
https-proxy=http://yourorganizationproxy.com:8080
strict-ssl=false
Save
Hope it helps

Installing Vue-CLI, VUE.JS, JavaScript

I am trying to Install the VUE CLI into my laptop but it gives following errors.
λ npm install -g vue-cli
npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.nmpjs.org/vue-cli failed, reason: connect ETIMEDOUT 218.93.250.18:443
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! C:\Users\ABDUR REHMAN KHALID\AppData\Roaming\npm-cache\_logs\2018-01-29T07_46_22_789Z-debug.log
This is not a Vue issue. It seems like your registry is set to the wrong url. Set registry to the correct url with:
npm config set registry https://registry.npmjs.org/
if you are trying to install vue-cli then you should try this.
sudo npm install --global vue-cli

Unable install angular 2 node modules due to proxy connection setings

I am using Node 8.1.3 and npm 5.0.3. When i Install npm install -g #angular/cli
i am getting connection refused and some proxy errors.I also registered proxy settings in npm registry still i am getting the same proxy connection refused error Please filnd error image as an attachment.
If u are running behind a proxy please make sure that proxy config set properly
How to resolve this issue?
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! C:\Windows\System32\npm-debug.log

Categories

Resources