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

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

Related

Not able to install cypress from Node package using npm i cypress -g

When I am trying to install Cypress from NPM I am getting below error. I have Used the correct proxy also but the issue still remains the same.
C:\Users\mXXXXX\Work\Toolss\Test>npm i cypress -g
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
C:\Users\mXXXXX\AppData\Roaming\npm\cypress -> C:\Users\mXXXXX\AppData\Roaming\npm\node_modules\cypress\bin\cypress
cypress#5.3.0 postinstall C:\Users\mXXXXX\AppData\Roaming\npm\node_modules\cypress
node index.js --exec install
Installing Cypress (version: 5.3.0)
× Downloading Cypress
→ Cypress Version: 5.3.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/5.3.0?platform=win32&arch=x64
Error: unable to get local issuer certificate
Platform: win32 (10.0.17134)
Cypress Version: 5.3.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! cypress#5.3.0 postinstall: node index.js --exec install
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the cypress#5.3.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\mXXXXX\AppData\Roaming\npm-cache_logs\2020-09-29T14_52_51_373Z-debug.log
Thanks in advance.

Expo project not starting

My expo project doesn't start when I try to use npm start.
Versions that I am using are
Expo-cli: 3.20.5
Node : 12.16.3
Flow:
expo init project
-> blank template
expo start
After running the expo start command it gives the following error
Cannot determine which native SDK version your project uses because the module `expo` is not installed. Please install it with `yarn add expo` and try again.
ConfigError: Cannot determine which native SDK version your project uses because the module `expo` is not installed. Please install it with `yarn add expo` and try again.
at Object.getExpoSDKVersion (C:\Users\Talha\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\config\src\Project.ts:35:9)
at ensureConfigHasDefaultValues (C:\Users\Talha\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\config\src\Config.ts:419:22)
at fillAndReturnConfig (C:\Users\Talha\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\config\src\Config.ts:101:10)
at configureProjectAsync (C:\Users\Talha\AppData\Roaming\npm\node_modules\expo-cli\src\commands\start.ts:281:25)
at action (C:\Users\Talha\AppData\Roaming\npm\node_modules\expo-cli\src\commands\start.ts:157:34)
at C:\Users\Talha\AppData\Roaming\npm\node_modules\expo-cli\src\commands\start.ts:334:16
at Command.<anonymous> (C:\Users\Talha\AppData\Roaming\npm\node_modules\expo-cli\src\exp.ts:85:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # start: `expo start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
Then as mentioned in the above first line I ran npm install expo
After running the command for installing expo it gives me the following error
Error: React Native is not installed. Please run `npm install` in your project directory.
Couldn't start project. Please fix the errors and restart the project.
at startExpoServerAsync (C:\#expo\xdl#57.9.5\src\Project.ts:2080:11)
at Object.startAsync (C:\#expo\xdl#57.9.5\src\Project.ts:2397:5)
at action (C:\Users\Talha\AppData\Roaming\npm\node_modules\expo-cli\src\commands\start.ts:170:3)
at C:\Users\Talha\AppData\Roaming\npm\node_modules\expo-cli\src\commands\start.ts:341:16
at Command.<anonymous> (C:\Users\Talha\AppData\Roaming\npm\node_modules\expo-cli\src\exp.ts:85:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # start: `expo start`
npm ERR! Exit status 1
npm ERR! Failed at the # start script.
Then I ran npm install mentioned in the above error but then got this error
npm WARN deprecated deep-assign#3.0.0: Check out `lodash.merge` or `merge-options` instead.
npm WARN deprecated core-js#1.2.7: core-js#<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js#3.
npm ERR! code Z_BUF_ERROR
npm ERR! errno -5
npm ERR! zlib: unexpected end of file
after that when i again try to npm start it keeps repeating itself through the same errors I mentioned above
the problem is that npm install is not working on your machine, possibly due to some cache issues. you can run npm cache clean --force and then npm install again to try to resolve the issue
Illustration I had the same issue and cleaned up my node module. But the issue came back because I kill my server the wrong way. So I cleaned the repo again and close my server properly. And now I all the time close correctly my server. The issue didn't happen again for the moment.
=> Don't kill your cmd, you have to close the server correctly by doing CMD+C for win 10.

Inconsistent behavior while installing npm module

I am installing a npm module which use cmake-js inside it. (I mentioned cmake-js just for the information). I am behind a corporate proxy. (I have set proxy settings property). I have already set following configurations.
npm config set proxy http://xxxx:yyyy
npm config set https-proxy http://xxxx:yyyy
npm config set registry=https://registry.npmjs.org/
npm config set strict-ssl false
My npm version is 6.4.1. I can build the module without any problem when I switch to node version 8.10.0 using sudo n 8.10.0.
But when I move to node 8.0.0 version, I am getting the following error.
> cmake-js compile
info TOOL Using Unix Makefiles generator.
info TOOL Using c++11 compiler standard.
info DIST Downloading distribution files.
http DIST - https://nodejs.org/dist/v8.0.0/SHASUMS256.txt
ERR! OMG tunneling socket could not be established, cause=read ECONNRESET
ERR! OMG tunneling socket could not be established, cause=read ECONNRESET
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ur-node#1.0.0 install: `cmake-js compile`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ur-node#1.0.0 install 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/malintha/.npm/_logs/2018-09-17T14_23_42_781Z-debug.log
It seems like proxy issue, but it is working fine with node 8.10.0
What is the possible reason for this issue? Appreciate any insight to solve this issue.

How do I install node-oracledb behind a corporate firewall that blocks any public traffic?

Context
I am trying to install node-oracledb module by running npm install oracledb for my project (behind corporate firewall). I have the proper proxies set! (y)
But its keeps throwing the following error:
Yarn
λ yarn add oracledb
yarn add v1.7.0
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
error C:\Users\<username>\Documents\<path>\test\test-oracle\node_modules\oracledb: Command failed.
Exit code: 87
Command: node package/oracledbinstall.js
Arguments:
Directory: C:\Users\<username>\Documents\<path>\test\test-oracle\node_modules\oracledb
Output:
oracledb Beginning installation
oracledb Verifying installation
oracledb Continuing installation
oracledb ERR! NJS-054: Binary build/Release/oracledb.node was not installed.
oracledb ERR! Pre-built binary packages are not available for this version of Node.js (NODE_MODULE_VERSION="59")
oracledb ERR! Failed to install binary package oracledb-v2.3.0-node-v59-win32-x64.gz
oracledb ERR! connect ETIMEDOUT 192.30.255.113:443
oracledb ERR! For help see https://oracle.github.io/node-oracledb/INSTALL.html#troubleshooting
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
npm
λ npm install oracledb
> oracledb#2.3.0 install C:\Users\<username>\Documents\<path>\test\test-oracle\test-oracledb\node_modules\oracledb
> node package/oracledbinstall.js
oracledb Beginning installation
oracledb Verifying installation
oracledb Continuing installation
oracledb ERR! NJS-054: Binary build/Release/oracledb.node was not installed.
oracledb ERR! Pre-built binary packages are not available for this version of Node.js (NODE_MODULE_VERSION="59")
oracledb ERR! Failed to install binary package oracledb-v2.3.0-node-v59-win32-x64.gz
oracledb ERR! connect ETIMEDOUT 192.30.255.113:443
oracledb ERR! For help see https://oracle.github.io/node-oracledb/INSTALL.html#troubleshooting
npm WARN test-oracledb#1.0.0 No description
npm WARN test-oracledb#1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 87
npm ERR! oracledb#2.3.0 install: `node package/oracledbinstall.js`
npm ERR! Exit status 87
npm ERR!
npm ERR! Failed at the oracledb#2.3.0 install 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\<username>\AppData\Roaming\npm-cache\_logs\2018-06-11T19_17_03_152Z-debug.log
RCA and Findings
Upon looking at the oracledbinstall.js script that is responsible to get the module "installed", I could see one issue right away.
The script starts with the following:
So I am fairly certain, when it tries to reach out to Github to grab the necessary binarie(s) and other scripts necessary for the oracledb module to run, it gets blocked by my Firewall.
Resolution?
So I would like to know if there is any way to successfully implement this.
I had the same issue running npm install oracledb behind a corporate firewall. Configuring the certificates didn't help, but it worked when I put it in the same line. I also specified which binaries I needed when it gave this error:
oracledb ERR! Pre-built binary packages are not available for this version of Node.js (NODE_MODULE_VERSION="59")
oracledb ERR! Failed to install binary package oracledb-v2.3.0-node-v59-win32-x64.gz
.
.
.
npm ERR! oracledb#2.3.0 install: `node package/oracledbinstall.js`
npm ERR! Exit status 87
npm ERR!
npm ERR! Failed at the oracledb#2.3.0 install script.
My Resolution:
I was able to get it installed with this line:
npm install --cafile "/path/to/myCA.cert" oracle/node-oracledb.git#v2.3.0
I hope this would be able to help someone coming across this issue.
Read the node-oracledb installation instructions about setting https_proxy - this is the 'proper' proxy, since any npm config proxy can't/won't be read by oracledbinstall.js. Older npm's may also need http_proxy set.
If your proxy needs authentication, then follow along or contribute to https://github.com/oracle/node-oracledb/pull/919
If you can't get through your proxy, then read up on Manually Extracting Pre-built Binaries

Unable to install electron from npm

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.

Resources