electron install error : Generated checksum for "electron-v2.0.2-win32-x64.zip" did not match expected checksum - npm

I want to install latest electron version in my existing angular application.So I followed npm command to install it.
Command : npm i electron#latest
Expected Behavior
Electron should installed successfully.
Actual Behavior
So, Whenever I tried to install electron, after downloading zip file and SAMSUN.txt file , it is throwing below error....
Error: Generated checksum for "electron-v2.0.2-win32-x64.zip" did not match expected checksum.
at ChecksumMismatchError.ErrorWithFilename (E:\CityLawElectron\node_modules\electron-download\node_modules\sumchecker\build.js:41:124)
at new ChecksumMismatchError (E:\CityLawElectron\node_modules\electron-download\node_modules\sumchecker\build.js:56:133)
at Hash. (E:\CityLawElectron\node_modules\electron-download\node_modules\sumchecker\build.js:203:22)
at emitNone (events.js:106:13)
at Hash.emit (events.js:208:7)
at emitReadable_ (_stream_readable.js:513:10)
at emitReadable (_stream_readable.js:507:7)
at addChunk (_stream_readable.js:274:7)
at readableAddChunk (_stream_readable.js:250:11)
at Hash.Readable.push (_stream_readable.js:208:10)
Please note that I have tried to clear my npm cache using npm cache clean --force command and tried to install. but it didn't work.
I also tried to install electron globally using npm i -g electron#latest, but that approach also didn't work.
Please provide solution as soon as possible because I m really stuck at this problem.
Electron Version: 2.0.2
Operating System : windows
node version : 8.11.2
npm version : 6.1.0
Last known working Electron version:

We can solve this issue by using following steps (OS - Windows 10)
Delete "SHASUMS256.txt-x.x.xx" file from "C:\Users{{UserName}}.electron".
Delete Cache folder from "C:\Users{{UserName}}\AppData\Local\electron".
Delete electron from node_modules folder.
Then install electron globally and locally by using following commands -
npm init -y //Note: The -y flag provides default options automatically
npm install electron -g //install electron globally
npm install electron --save-dev --save-exact //install electron as devdependencies
If you are using typescript then install it as global using below command-
npm install -g typescript
Above steps may help you.

Related

error installing cypress on windows 64 with npm

I'm seeing an error when attempting to install the latest cypress on my Windows 10 machine. I was using cypress 8.7 just fine. I deleted node_modules and package-lock.json and removed "cypress": "^8.7.0", from package.json.
Now installing cypress (9.1) I see this error:
npm install --save-dev cypress
npm ERR! Error: Cannot find module 'har-validator'
I see the same error when trying to use the old version too
npm install --save-dev cypress#8.7.0
System info from powershell:
node -v
> v16.8.0
npm -v
> 7.21.0
UPDATE:
My friend is able to install with dependency 8.7.0 in package.json, on OSX with nodejs 14.16.0.
This works today (2021-11-26) for me
npm install --save-dev cypress#8.7.0
There is a Bug in #cypress/request.
Take a look at https://github.com/cypress-io/request/pull/15
EDIT: There is a PR from one of the devs. https://github.com/cypress-io/request/pull/16
Looks like Cypress issue with latest versions. we have this problem for v8.7.0 today. "npm install har-validator" manually installed the missing har-validator module, that helped.

Cypress cannot run because this binary file does not have executable permissions

I was trying to create a new project in cypress and I got the following strange error message.
Steps:
npm init -y
npm install cypress --save-dev
I then did npx open cypress and I got the following message from my console
How do I fix this?
Cypress cannot run because this binary file does not have executable permissions here:
/Users/myName/Library/Caches/Cypress/7.5.0/Cypress.app/Contents/MacOS/Cypress
Reasons this may happen:
- node was installed as 'root' or with 'sudo'
- the cypress npm package as 'root' or with 'sudo'
Please check that you have the appropriate user permissions.
You can also try clearing the cache with 'cypress cache clear' and reinstalling.
----------
Platform: darwin (20.5.0)
Cypress Version: 7.5.0
You can do two things:
Run the command npm cypress cache clear and then again install cypress npm install cypress --save-dev and check.
Or, install npm globally without sudo using the command npm install -g. Then create a new folder and then run npm init, npm install cypress --save-dev and npx cypress open.
Do navigate to the cache directory by doing
cd /Users/myName/Library/Caches/
Here you have to delete Cypress directory completely by running the command
rm -rf Cypress
Now head over to your project directory and run the command
npx install cypress
Cypress will be installed in your system again. Next time you won't get any errors.
So, I had a chat with the dev team at Cypress and got the following answer. After reading the logs I had a feeling this might be the root cause. So please check you have the most up to date version of Node.js

How to Update Angular Cli

Just to give you some context.
I was running a project and after ng serve I was getting this warning message:
our global Angular CLI version (9.1.4) is greater than your local
version (1.0.0). The local Angular CLI version is used.
I googled and figured out I should update angular cli with the following command.
npm install --save -dev #angular/cli#latest
After that I am getting the following error when trying to build the project:
The build command requires to be run in an Angular project, but a project definition could not be found
Any help will be much appreciated.
After reading some issues reported on the GitHub repository, I found the solution.
In order to update the angular-cli package installed globally in your system, you need to run:
npm uninstall -g angular-cli
npm install -g #angular/cli#latest
Depending on your system, you may need to prefix the above commands with sudo.
Also, most likely you want to also update your local project version, because inside your project directory it will be selected with higher priority than the global one:
rm -rf node_modules
npm uninstall --save-dev angular-cli
npm install --save-dev #angular/cli#latest
npm install
After updating your CLI, you probably want to update your angular version too
Note: if you are updating to Angular CLI 6+ from an older version, you might need to read this
Edit: In addition, if you were still on a 1.x version of the cli, you need to convert your angular-cli.json to angular.json, which you can do with the following command:
ng update #angular/cli --from=1.7.4 --migrate-only
check here for more details.

'npm ERR! 404 Not Found: async-validator' while installing Element-UI

I keep getting
npm ERR! 404 Not Found: async-validator#~1.8.1
while trying to install Element-UI. Tried installing async-validator through npm and got the same error, tried reinstalling Node, ...
node v10.2.1
npm 6.1.0
Any help is appreciated
EDIT:
I followed the first link MantasPtr commented and was able to install async validator like so:
npm install https://github.com/yiminghe/async-validator/archive/1.8.2.tar.gz
Do not specify the version code while installing a new version of library using npm. It might download the order version of that library
Specify the library name as it is to install the latest version or specify #latest
npm install async-validator --save
or
npm install async-validator#latest --save
May be, this is a temporary solution:
npm install https://github.com/yiminghe/async-validator/archive/1.8.1.tar.gz
if you try to load npm install https://github.com/yiminghe/async-validator/archive/1.8.2.tar.gz in a browser, you will see {"error":"Not found"} as a result.
but https://github.com/yiminghe/async-validator/archive/1.8.1.tar.gz will be found. So I work with an older version and will look for an update later.

Cannot install phantomJS in Karma

WARN [config]: config.configure() is deprecated, please use config.set() instead.
WARN [plugin]: Cannot find plugin "karma-phantomjs".
Did you forget to install it ?
npm install karma-phantomjs --save-dev
INFO [karma]: Karma v0.10.2 server started at http://localhost:9018/
WARN [launcher]: Can not load "PhantomJS", it is not registered!
Perhaps you are missing some plugin?
Getting this error. When running npm install karma-phantomjs --save-dev I get an error.
npm ERR! 404 'karma-phantomjs' is not in the npm registry.
I installed karma-phantomjs-launcher --save-dev but i still get an error when running grunt watch.
Anyone else run into this issue?
npm install karma-jasmine --save-dev
npm install karma-phantomjs-launcher --save-dev
Then add the following line to karma.config.js
plugins : ['karma-jasmine', 'karma-phantomjs-launcher']
I got tripped up by this today running
karma: 0.13.7
karma-phantomjs-launcher: 1.0.0
What isn't very obvious is that the launcher has a dependency on:
phantomjs-prebuilt
So if you, install this locally everything should run fine, eg:
npm install phantomjs-prebuilt --save-dev
After some research I realized that I needed to run:
npm install -g karma#canary phantomjs karma-phantomjs-launcher
Once I ran that I went back into my karma-unit.tpl.js file and instead of karma-phantomjs, I changed this to karma-phantomjs-launcher.
Now when I execute a command like grunt build, I get no error regarding phantomJS
This is an issue still open on the repo: #31
Strangely enough the following worked for my Debian based system:
apt-get install libfontconfig
How did I get into this? Reading a comment from the ticket. Hope this will help for others too :-)
I'm running in a CentOS 7 Docker container. Had similar issue.
Had to:
yum install -y tar bzip2 freetype fontconfig
Then
npm install phantomjs --save-dev
worked without errors, which allowed
npm install karma-phantomjs-launcher --save-dev
and that allowed
gulp test
to run without Karma or PhantomJS errors.
Today I had the same. I deleted all the temporary directories and, after rerun it worked.
Before that i also reinstalled phantomjs but without success. It's possible that this influenced, anyway (but i think deleting the temporary directories did the job). Anyway, after deleting temporary folders you can try, if it didn't work you can reinstall phantomjs and also other stuff as other users already wrote.