Unable to install electron from npm - node.js

I am trying to install electron on my ubuntu 16.04, i already have a working nodejs and npm. But suddenly I am unable to install modules by type:
sudo npm install electron
Below is the response am getting:
npm WARN registry Unexpected warning for https://registry.npmjs.org/:
Miscellaneous Warning EAI_AGAIN: request to
https://registry.npmjs.org/electron failed, reason: getaddrinfo
EAI_AGAIN registry.npmjs.org:443
npm WARN registry Using stale package data from
https://registry.npmjs.org/ due to a request error during
revalidation.
> electron#1.7.10 postinstall
/home/arthur/Documents/Programming/Electron/node_modules/electron
> node install.js
`/home/arthur/Documents/Programming/Electron/node_modules/electron/
install.js:48
throw err
^
Error: read ECONNRESET
at _errnoException (util.js:1024:11)
at TLSWrap.onread (net.js:615:25)
npm WARN y#1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron#1.7.10 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron#1.7.10 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely
additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/arthur/.npm/_logs/2017-12-19T10_25_52_312Z-
debug.log

The issue is related to proxy configuration. Based on this answer, you can try the following.
First, try to remove if there exists your initial config:
npm config rm proxy
npm config rm https-proxy
And optionally if needed, try to set your proxy config
npm config set proxy proxy-url
npm config set https-proxy proxy-url

I tried everything but it seems I was using CENTOS which allowing me to install electron. I got help from FlashJonas: and tried installing electron again and it was installed as expected.
sudo npm install electron -g --verbose --unsafe-perm=true

Removing the proxy and https-proxy worked for me, just in case there is another person with a similar situation.
just enter the following in your terminal:
npm config rm proxy
npm config rm https-proxy

Do Any of the following. It Work for me.
Change Internet Connection.
Delete all electron file and then install npm insatll electron.
Try to install old version of electron.
This Error is because it can't able to download "electron-v11.2.1-win32-x64.zip" file. So Change Internet Connection it work for me.

I am behind a corporate proxy and had similar issues. None of the options above helped. In the end, I followed the instructions below to reconstruct the electron cache manually, so that it will not have to hit the network to download the binaries:
https://www.electronjs.org/docs/v14-x-y/tutorial/installation#custom-mirrors-and-caches
Basically I used a personal laptop (i.e. not behind the proxy) to install the latest electron on some test app, and then copied the %LOCALAPPDATA%\electron\Cache folder from my personal to the corporate laptop. Everything worked fine.

Related

Error while installing firebase with npm - ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC

I am trying to install firebase but no matter what I do I keep getting this Error:
npm ERR! code ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC
npm ERR! errno ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC
npm ERR! Invalid response body while trying to fetch https://registry.npmjs.org/#firebase%2Fapp: 39732:error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac:c:\ws\deps\openssl\openssl\ssl\record\ssl3_record.c:677:
I get this error after running npm i firebase or npm i --save firebase. It doesn't happen when I install any other package
I have tried all sorts of commands like npm cache clear --force, npm config set strict-ssl false, npm config set registry http://registry.npmjs.org, no combination of them seams to fix it.
I am using npm version 8.5.4 and node version v16.14.0
When I run npm config get cafile it outputs null
I tried searching for what a certificate means without any success.
Any help is greatly appreciated
If you are using windows, search "services" in the start menu, then check the "OpenSSH Authentication Agent" service. If the startup type is "disabled", select "automatic (delayed startup)". then restart the computer and try to install firebase. this solved my problem.
please try this command : npm i --save firebase -d it helped me.

Error while trying to create react app using npm

I'm trying to creating react app using create-react-app command but I get this error message:
npm ERR! code ERR_SOCKET_TIMEOUT
npm ERR! errno ERR_SOCKET_TIMEOUT
npm ERR! network Invalid response body while trying to fetch https://registry.npmjs.org/dotenv-expand: 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! C:\Users\IMAD\AppData\Local\npm-cache\_logs\2022-02-12T18_27_46_293Z-debug-0.log
I tried to clean cache:
npm cache clean -f
I also tried restarting the computer and reinstall nodejs and npm, but nothing was fixed.
Can anyone know what is the issue? and how can I solve it?
You should use npx command (not npm) like that as in official documentation : https://reactjs.org/docs/create-a-new-react-app.html
npx create-react-app my-app
After more than 3 days of working on this error, I found the solution and fixed the problem by install another version of Nodejs.
The current version was v16.14.0 when I got this error. And now it's v16.0.0 and everything's is work just fine.
New versions of nodejs are not stable, downgrade to 16.0.0 was the better thing i made.
I solved this using the following command.
npm uninstall -g create-react-app
then
npm install -g create-react-app

Unable to install cypress via npm - whereas we dont have any proxy

I am trying to install npm install cypress. but getting below error as am working from Home so no proxy or firewall stopped but still failed
even tried with multiple set proxy but still dint work.
my doubt is what we need to give proxy
D:\CypressAutomation>npm install cypress
npm WARN registry Using stale data from https://registry.npmjs.org/ because the host is inaccessible -- are you offline?
npm WARN registry Using stale data from https://registry.npmjs.org/ due to a request error during revalidation.
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
cypress#7.1.0 postinstall D:\CypressAutomation\node_modules\cypress
node index.js --exec install
Installing Cypress (version: 7.1.0)
× Downloading Cypress
→ Cypress Version: 7.1.0
Unzipping Cypress
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:
URL: https://download.cypress.io/desktop/7.1.0?platform=win32&arch=x64
Error: tunneling socket could not be established, cause=getaddrinfo ENOTFOUND proxy
Platform: win32 (10.0.19041)
Cypress Version: 7.1.0
npm WARN cypressautomation#1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! cypress#7.1.0 postinstall: node index.js --exec install
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the cypress#7.1.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ssuparna\AppData\Roaming\npm-cache_logs\2021-04-23T19_38_29_200Z-debug.log

Node Js: Error - Unable to verify leaf signature when installing Express Framework

I need to install Express Framework for my application.
This is the error which I am obtaining. I tried to set Environment varaibales for my computer towards npm as http://username:password#proxy:port for both http and https.
Also, I have tried the code such as
npm config set proxy http://username:password#proxy:port -g
npm config set https-proxy http://username:password#proxy:port -g
npm config set strict-ssl false.
Even then I am getting the below error.
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! code UNABLE_TO_VERIFY_LEAF_SIGNATURE
npm ERR! unable to verify the first certificate
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
Any help regarding installing Express Framework would be appreciated.
I have also faced same problem, but your last option i.e.
npm config set strict-ssl false worked for me.
after run this command in command prompt I installed express framework with following command:
npm install -g express-generator
Even I got the same error while installing angular cli...
I have used the command "npm config set strict-ssl false" in cmd and then installed using npm install -g #angular/cli...It worked...Thanks
npm config set strict-ssl false should fix it.
In my case it was in a docker environment and I did not copied the .yarnrc that included the sstrict-ssl false directive to the image in the build phase.
Issue:
>npm install
npm ERR! code UNABLE_TO_VERIFY_LEAF_SIGNATURE
npm ERR! errno UNABLE_TO_VERIFY_LEAF_SIGNATURE
npm ERR! request to https://registry.npmjs.org/#webassemblyjs/ieee754/-/ieee754-1.7.6.tgz failed, reason: unable to verify the first certificate
Solution:
npm install worked after executing this command:
npm config set strict-ssl false

windows: npm install getting error ERR! code ECONNRESET

I try to install ionic, but when run npm install -g ionic I have error below.
npm ERR! node v0.12.4
npm ERR! npm v2.10.1
npm ERR! code ECONNRESET
npm ERR! network socket hang up
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'
My network don't have proxy, and when i run npm get proxy it said null
I already try to clean cache, and change registry to http://registry.npmjs.org/ and https://registry.npmjs.org/ and also I can access http://registry.npmjs.org/yo, but still have same error when installing ionic.
hope any solution for my issue.
Thank you,
There is some dependency problem.
see below link :
http://ionicframework.com/docs/concepts/development.html
Improved answer Below :
By default, brew install latest stable version of node (in this case 0.12.4). Based on the warning messages, ionic is expecting a lower version of node.
I was able to to solve this issue by installing a prior version of node (0.10.38).
$ brew remove node
$ rm ~/.node (might want to rename instead)
$ brew install homebrew/versions/node010
$ node --version
$ v0.10.38
Run npm install -g ionic worked as expected.

Resources