I'm trying to install electron using both npm(npm install electron) and yarn but stuck into a bottleneck issue. PFB the error msg
Error: self signed certificate in certificate chain
at TLSSocket.onConnectSecure (_tls_wrap.js:1473:34)
at TLSSocket.emit (events.js:311:20)
at TLSSocket._finishInit (_tls_wrap.js:916:8)
at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:686:12) {
code: 'SELF_SIGNED_CERT_IN_CHAIN'
}
So, in order to bypass ssl I ran the command npm config set strict-ssl=false and tried again.
Butr now, I get a new error.
ChecksumMismatchError: Generated checksum for
"electron-v5.0.13-darwin-x64.zip" did not match expected checksum.
PFB the versions I'm using.
Node - v12.16.1
npm - 6.13.4
OS - macOS mojave 10.14.16
I struggled with self-signed certificates on an enterprise network too and this is what helps in my case. Whenever I want to install a version of electron, I download the electron-vX.Y.Z-win32-x64.zip and place it in electrons local cache folder. Which is %APP_DATA%\Local\electron\Cache on windows systems.
After that I run a normal npm install. It will look for a cached zip file, find one and use that.
The cache locations for the other operating systems can be found here:
https://www.electronjs.org/docs/tutorial/installation#cache
Edit:
Respondong to your comment - there are a couple of old entries on the electron issue tracker on github, search that for 'ChecksumMismatchError', it hints for mismatching versions of electron, node and maybe other dependencies. One solution would be to calculate the checksum of the zip (assuming, you got it from a trusted source!!) and update the package-lock.json (or yarn). Or - upgrade to the latest version of electron. That's what I recommend, then you get the latest and safest chromium.
https://github.com/electron/electron/issues/13168#issuecomment-400079161
Found the solution. It was the firewall's issue. Temporarily disabled it to proceed with the installation.
Related
whenever i run this command: npm run dev, I get the following error. this is a sveltekit and vite (which i'm very new to) project.
> my-app#0.0.1 dev
> vite dev
failed to load config from /home/believe/Documents/my-app/vite.config.js
error when starting dev server:
Error [ERR_MODULE_NOT_FOUND]: Cannot find package '#sveltejs/kit' imported from /home/believe/Documents/my-app/vite.config.js.timestamp-1659118538332.mjs
at new NodeError (node:internal/errors:363:5)
at packageResolve (node:internal/modules/esm/resolve:698:9)
at moduleResolve (node:internal/modules/esm/resolve:739:18)
at Loader.defaultResolve [as _resolve] (node:internal/modules/esm/resolve:853:11)
at Loader.resolve (node:internal/modules/esm/loader:89:40)
at Loader.getModuleJob (node:internal/modules/esm/loader:242:28)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:73:40)
at link (node:internal/modules/esm/module_job:72:36)
IMHO, using / switching-to the latest version of node should ideally resolve this issue. I had faced this error, and switching to the latest version of node is what worked for me.
I have found that installing the nvm (node version manager) cli package is one of the best and handy ways to address and handle such situations. This is because, it will let you install and manage multiple versions of node, so that you can switch node versions, between projects, as needed per relevant dependencies.
For eg., in this case, I would just say nvm use latest in the project cli, and nvm will switch to the latest node version (if/where installed ==> node v18.7.0 w/ npm 8.15.00 as of now, for me, for eg. ).
At that, nvm ls lists all the installed node versions on that system/ environment, and points to the one in use at the moment. Very handy!
More info on nvm here: http://nvm.sh/
[* Since you have not mentioned the OS/ENV and Terminal etc., I can not unfortunately (at this time) share specific install instructions, and am hence pointing to the nvm git. Hope you understand. :) ]
Hope this helps; have a nice day! :)
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.
I am on different servers and run npm install
One server is ok. Another failed showing below error:
no matching version found for es-abstract#1.14.0
I tried npm ci. Same deal.
Then I did npm install es-abstract-1.14.0.tgz
But the size node_modules/ are different. I am using du -shc --apparent-size node_modules/ to ignore the sparse files within the folder. Why?
Could I accept that this is the network issue of the failed server? And just keep doing this? I mean, is the installation still going to be ok in this way?
At the time that this answer was written, there are 33 release versions for es-abstract on github, but only 32 release versions are listed on its npm registry. The missing version in the registry is 1.14.0.
Perhaps on one of your servers, you had this package cached (maybe it was previously listed on the NPM registry?, or maybe from downloading it from github?), and on the other server you did not have this package cached.
I had this same error message when trying to npm install a project from github.
In my situation, the es-abstract package was not explicitly listed in the package.json file, but it was a dependency of another package. Therefore I explicitly added it with the next highest version listed on the registry, and it worked.
e.g.
"dependencies": {
"es-abstract": "1.14.1",
...
Just a guess, but maybe 1.14.0 used to be listed on the registry, but now it's not?
Upon executing the following command:
npm install #angular/animations#'^5.2.0' #angular/common#'^5.2.0' #angular/compiler#'^5.2.0' #angular/compiler-cli#'^5.2.0' #angular/core#'^5.2.0' #angular/forms#'^5.2.0' #angular/http#'^5.2.0' #angular/platform-browser#'^5.2.0' #angular/platform-browser-dynamic#'^5.2.0' #angular/platform-server#'^5.2.0' #angular/router#'^5.2.0' typescript#2.4.2 rxjs#'^5.5.2'
I get messages saying that no compatible version of found for rxjs. Then when I remove the specific version, it says no compatible version is found for angular/animations. Then angular/common. Etc etc.
I'm pretty sure these versions are valid, since they're the ones recommend by this Angular upgrade tool (https://angular-update-guide.firebaseapp.com/) and I can also see the "valid install target" list, which includes the versions I'm trying to install.
I know our project's dependencies are in some special repository somewhere (Artifactory, I think?) so maybe this is happening because these versions are not in the repo NPM is looking at.
Is there a way to fix this for testing purposes before committing to having to install the new versions in the repo? In other words, how do I point NPM at the NPM repo rather than the company's repo?
Well, the answer I was looking for was here:
How to specify registry while doing npm install with git remote url?
However that didn't actually work.
The problem was simply a syntax issue. After I removed all the quotes from my command so it looked like the following command, it worked
npm install #angular/animations#^5.2.0 #angular/common#^5.2.0 #angular/compiler#^5.2.0 #angular/compiler-cli#^5.2.0 #angular/core#^5.2.0 #angular/forms#^5.2.0 #angular/http#^5.2.0 #angular/platform-browser#^5.2.0 #angular/platform-browser-dynamic#^5.2.0 #angular/platform-server#^5.2.0 #angular/router#^5.2.0 typescript#2.4.2 rxjs#^5.5.2
Apache Cordova Dependency Checker fails in VS Community 2015. It was previously working on this computer until I ran several VS and 3rd party tools updates. Here's what I've done to try to resolve the issue:
Installed VS / Apache Cordova (no error messages displayed) following article https://taco.visualstudio.com/en-us/docs/install-vs-tools-apache-cordova/
Run Apache Cordova Dependency Checker but VS freezes with the error message - VS 2015 has stopped working, windows will try to restart the program.
I restarted VS and cleared Cordova cache, checked environment variables (all good), then tried Apache Cordova Dependency Checker with the same freeze result.
I tried to update Apache Cordova with the fix option (no error messages) but received the same freeze results.
I completely uninstalled Apache Cordova, 3rd party tools (following article https://support.microsoft.com/en-us/kb/3016536), and VS community and then reinstalled them (no error messages) but received the same freeze results.
I installed Apache Cordova on another computer and the dependency checker phonegap app... worked. Unfortunately that's not a computer that I have access to.
What else can I do to resolve the Apache Cordova installation issue?
Thanks for any help,
Mike
Since my original post, I've had to resolve Visual Studio, Ionic, Cordova, Phonegap, plugin... environment issue several times. I've found the below works best:
Ensure platform matches plugin requirements, see platform in config.xml e.g. 6.1.1
Uninstall, reinstall latest jdk (adobe)
Clear MEF Cache - download the tool and follow instructions
Download/install latest node.js
Run the following from the command line:
Clear cache: Npm cache clean
Install latest npm: npm install -g npm
Uninstall cordova: Npm uninstall -g cordova
Reinstall cordova: Npm install –g cordova (note, this took 5+ tries to complete without errors. No other changes were made between runs. Not sure
why. Found others complaining about the same issue.)
Remove Android platform: Cordova platform remove android
Install Cordova platform add android#6.X.X (Note, as of 4/20/17 cordova and android compatibility issue. Build error - unable to find installed version of gradle. resolved by running (npm install -g cordova#6.4.0) and (cordova platform add android#6.1.2). Addt'l build errors, resolved by updating components in Android SDK Manager)
Uninstall/Reinstall plugins from the command line. For example:
cordova plugin remove phonegap-plugin-push
cordova plugin add phonegap-plugin-push variable SENDER_ID="YourID#"
npm install bower -g
Restart Visual Studio - Verify plugins were installed via config.xml
Install Ionic:
npm uninstall -g ionic
npm install -g ionic (note: to install specific version, npm install -g ionic#2.2.3)
$ ionic platform add ios
$ ionic platform add android (note: redundant, already added above)
I recommend putting as much of this as possible in a batch file with a pause between commands. Verify each command was successful, if not press ctrl+break at the pause to term the batch file early. The batch file is an easy way to restore your environment when everything breaks again. Stuff happens!
I also started using a VM (oracle virtualbox) for my development environment. That way I can backup my environment before making changes and easily restore. Don't forget to upload to GIT on a daily basis. GIT and VMs are my lifesavers.
Cool NPM commands:
npm list (lists all installed packages)
npm prune (removes packages not depended on by your project according to your package.json)
npm outdated (tells you which installed packages are outdated with respect to what is current in the npm registry but allowable by the version definition in your package.json. Make sure all up-to-date)
Please feel free to add/make suggestions to the above list.
-Mike