Cannot install some packages from npm - npm

My computer has a strange problem. Whenever I try to install some npm packages like ionic and cordova, it fails giving some shasum check failed error.
Like this cmd snapshot:
This has happened with other packages like generator-ionic
I've also checked for proxy setups in Internet Options and Router Settings, there are none.
Also, when I try to install these packages using my phone's data connection (usb tethering) they get installed without any problems.
I am assuming there is some problem with my internet connection, but can't seem to figure out what it is.

If your network is blocking the npm repository ,You may get this error ,Please use fiddler to debug you npm is able to connect to repository

Related

npm install command doesn't work for me. ECONNRESET

I am trying to install an NPM package in a project but the installation does not go beyond the buildDeps phase and after a while it gives me the error ECONNRESET. This happens to me with any package I try to install:
I tried to install Express and Angular and couldn't.
Try connecting your device to Internet. NPM is a Package manager which add packages stored in servers and deliver to their users.
If problem still persists, try to install NodeJS again

while installing cypress through command :npm install cypress --save-dev getting error as The Cypress App could not be downloaded

while installing cypress through command :npm install cypress --save-dev getting error as The Cypress App could not be downloaded.
Error :
Finishing Installation
The Cypress App could not be downloaded.
Does your workplace require a proxy to be used to access the Internet? If so, you must configure the HTTP_PROXY environment variable before downloading Cypress. Read more: https://on.cypress.io/proxy-configuration
Otherwise, please check network connectivity and try again:
But please not I m not using any proxy and on my personal wifi.
plz suggest ,what can be done in this case.Thanks
It seems to be too many possible reasons for this issue in general but I managed to find a workaround to install Cypress from within a corporation with npm and without using sudo npm or turning off strict ssl.
The following worked for me per November 18th 2020 with Ubuntu 18.04 and npm 6.14.8:
I downloaded the zip file shown in https://docs.cypress.io/guides/getting-started/installing-cypress.html#Direct-download
I installed cypress as shown in https://docs.cypress.io/guides/getting-started/installing-cypress.html#Install-binary : CYPRESS_INSTALL_BINARY=~/Downloads/cypress.zip npm install cypress --save-dev
I could now run npx cypress open to start the gui (which will also generate the cypress.json file)
Possible Reasons for this issue:
U might be running the project with a proxy setting.
One of the reason could be you are behind the firewall.that may prohibit your network? Please follow the guidelines in Proxy Configuration if so(https://docs.cypress.io/guides/references/proxy-configuration.html#Set-a-proxy-on-Linux-or-macOS).
make sure you have right access to install the cypress.
if none of the above mentioned reasons try removing the biraries or node_modules and install again.

Error 403 - Forbidden while trying npm install

So just like every day I do different projects and install additional modules, today I want to install another module and such an error, reinstall the server and still the same .... [Error]The error appeared overnight
I found the issue from here: https://github.com/npm/npm/issues/2119#issuecomment-5321857
It's a very common issue in npm. Actually npm is not working good with HTTPS over a proxy. Changing the registry URL from HTTPS to HTTP will fix the problem.
Try this out:
npm config set registry http://registry.npmjs.org

can not install react native web-view

I try installing "react native web view" but when I run "npm install --save react-native-webview" it takes a lot of time and nothing will happen. And when I try using yarn to install the library I get the following error:
There appears to be trouble with your network connection. Retrying...
I do not have any problem with internet connectivity or proxy! I can run npm install well but I cannot install the library at all.
I have tried to increase npm timeout but the related command does not work too. Please help me...
I solved my problem with using these two commands.
npm config rm proxy
npm config rm https-proxy

“Unexpected Token <” error in HTML while using socket.io via npm

I know this issue has been discussed in an old post. But in that scenario the developer was importing socket.io via a script tag. I am getting the same error on my local build and I have installed socket.io using npm.
Has anyone had a similar issue? How can this be corrected?
Turned out to be an npm cache issue for me. After several attempts I was able to resolve this by clearing my npm cache, deleting all of the modules, and then re-running npm install.