get an error while trying to run create-react-app [duplicate] - node.js

I am getting this error while running sudo npm install. On my server, npm was installed earlier. I've tried to delete the package-lock.json file, and ran npm cache clean --force, but it didn't work.
My npm version is 5.3.0.
The error:
npm ERR! code EINTEGRITY
npm ERR! sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA== integrity checksum failed when using sha512: wanted sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA== but got sha512-WXI95kpJrxw4Nnx8vVI90PuUhrQjnNgghBl5tn54rUNKZYbxv+4ACxUzPVpJEtWxKmeDwnQrzjc0C2bYmRJVKg==. (65117 bytes)
npm ERR! A complete log of this run can be found in:
npm ERR! /home/ubuntu/.npm/_logs/2017-11-29T05_33_52_182Z-debug.log

See https://github.com/npm/npm/issues/16861
This worked for me:
npm cache verify
Then I re-ran:
npm install -g create-react-app
And it installed as expected: Issue resolved.
Other solutions mentioned in the GitHub issue include:
npm cache clean --force
OR
Deleting npm and npm-cache folders in Users%username%\AppData\Roaming (Windows 7 and Windows 10) and running npm install
OR
Update npm by via npm i -g npm
OR
Delete package-lock.json
OR
npm cache clean
OR
Do these steps to fix the problem:
Find all outdated packages and update theme:
npm outdated -g
sudo npm i -g outDatedPKG
Upgrade npm to latest version with:
sudo npm i -g npm
Delete package-lock.json file.
Delete _cacache directory in ~/.npm:
npm cache verify
Every time I get that error, do steps 2 & 3.
If you still get the error, clear npm's cache:
npm cache clean --force
OR
Add proxy to .npmrc in ~ directory:
proxy=http://localhost:8123
https-proxy=http://localhost:8123
Try again! slow internet connection and censorship may cause this ugly problem.
OR
npm cache clear --force && npm install --no-shrinkwrap --update-binary
OR
npm config set package-lock false

Delete package-lock.json file and then try to install

The issue was indeed in package-lock.json, and after replacing it with a working version from another branch it worked.
What's interesting is seeing the diff:
So there really is some integrity checksum in the package-lock.json and it was replaced in our package-lock.json with a SHA1 instead of a SHA-512 checksum. See here for more info.
In case you don't have a working version in another branch. Consider the message
npm ERR! code EINTEGRITY
npm ERR!
sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==
integrity checksum failed when using sha512: wanted
sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==
but got
sha512-WXI95kpJrxw4Nnx8vVI90PuUhrQjnNgghBl5tn54rUNKZYbxv+4ACxUzPVpJEtWxKmeDwnQrzjc0C2bYmRJVKg==
. (65117 bytes)
Find the package in package-lock.json using the first checksum:
sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==
and put the third checksum into its "integrity" field:
sha512-WXI95kpJrxw4Nnx8vVI90PuUhrQjnNgghBl5tn54rUNKZYbxv+4ACxUzPVpJEtWxKmeDwnQrzjc0C2bYmRJVKg==
A more detailed description is here.

Actually the above is related to the network connectivity in side the server. When I've good connectivity in the server, the npm install gone good and didn't throw any error

My problem was 2 things:
Bad package-lock.json file
The existance of npm-shrinkwrap.json together with the package-lock.json file
What i did is:
Deleted the package-lock.json file
Delete the npm-shrinkwrap.json file
Ran npm install again (which recreated a good package-lock file)
Fixed my error!

I was stuck at this for a long time and this is what helped me.
Try this:
npm cache clean --force
npm install --update-binary --no-shrinkwrap
Found this answer after digging into GitHub issues!!

As a workaround, follow the below steps:
Go to the project directory
Remove the node_modules directory: rm -rf node_modules
Remove package-lock.json file: rm package-lock.json
Clear the cache: npm cache clean --force
Run npm install --verbose
If after following the above steps still the issue exists then please provide us the output of installation command with --verbose.

There are several valid and helpful responses here, but I would like to add that in my case the simplest solution was:
Delete package-lock.json;
Remove folder AppData\Local\npm\cache or AppData\Roaming\npm\cache;
Remove folder node_modules.staging;
Run npm install again.
After that everything ran smoothly.

I had a very similar problem, and in my case it worked by doing:
npm clean
This is the nuclear option since it clears every package from the cache as expained here.

Try the following:
npm cache clean --force
This has worked for me.

This Worked for me .
open the project in CMD
the run
npm cache verify
npm install
npm start

I was using private npm registry and trying to install private npm module. Logging to npm local registry fixed it (used command npm --add-user)

SherylHohman's answer solved the issue I had, but only after I switched my internet connection. Intitially, I was on the hard-line connection at work, and I switched to the WiFi connection at work, but that still didn't work.
As a last resort, I switched my WiFi to a pocket-WiFi, and running the following worked well:
npm cache verify
npm install -g create-react-app
create-react-app app-name
Hope this helps others.

I am behind my organization's proxy, running the following commands fixed the issue for me
npm config set proxy http://proxy.yourproxydomain.com:port
npm config set https-proxy http://proxy.yourproxydomain.com:port
npm config set strict-ssl false
npm config set registry https://registry.npmjs.org/

Updating .npmrc and the registry to https:// worked for me
registry=https://registry.npmjs.org/

This was not yet mentioned but make sure that your SYSTEM TIME is correct. If it is too out of sync it will cause a EINTEGRITY error. When you are doing npm publish / install.

None of the above answers worked for me. The solution to my issue was to change the way the snapshot dependency was consumed inside the package.json. Use the following template to pull in the snapshot dependency that you need
"dependency": "git+http://github.com/[pathtoproject].git#[branchname]",

I had the same issue. I used yarn instead of npm to install the dependencies and it worked.
yarn add *****

After going through all the answers and executing most of them. Although I resisted to try the Restart magic, eventually, the issue is solved after restart on my macbook(MacOS Catalina Ver. 10.15.7).
It seems like a cache issue indeed but none of the commands that I have executed cleared the cache.

What worked for me was npm cache verify then re-run your command. All should be good.

Updating the .npmrc files' entries for scoped and un-scoped packages worked for me.
So I ended up using the
npm config set #scope_name:registry SCOPED_REGISTRY_URL
and
npm config set registry PUBLIC_REGISTRY_URL

You should check Connection-specific DNS Suffix when type “ipconfig” or “ifconfig” in terminal

I faced same issue. Plus while I was trying to resolve from picking solutions from other devs, I faced few more issues like one listed here.
Angular 9 ng new myapp gives error The Schematic workflow failed
https://medium.com/#codewin/npm-warn-deprecated-request-2-88-2-b6da20766fd7
Finally after trying cache clean and verify and reinstall node of different versions and npm update, nvm and many other solution like set proxy and better internet connection, I still could not arrive to a resolve.
What worked for me is : I browsed a bit inside my C:\Users--- folder, I found package-lock.json and .npmrc files. I deleted those and reinstalled angular and tried. npm install and uninstall of different modules started working.

Before i was running this command
npm install typescript -g
after changing the command it worked perfectly.
npm install -g typescript

I faced this issue. It was my network connectivity. I changed network (from Broadband WiFi to 4G WiFi) and tried. It worked.
My broadband ISP was blocking all http requests. That might be the reason I guess in my case.

all solutions failed for me till i checked router settings; it was set to only IPV4.. i changed and put ipv4v6 and all is working fine now.

In my case the sha command was missing from my linux distro; steps were
added the packages for sha512 (on my distro sudo apt install hashalot)
npm cache verify
rm -rf node_modules
npm install

Easy and fast fix for me was to npm install the specific package on which it said the sha is wrong. Say your package is called awesome-package.
My solution was:
npm i awesome-package
This updated my sha within the package-lock.json.

If none of the above solved your problem, then just upgrade your npm verion and try. It worked for me.

Updating nodejs version worked for me.
curl -fsSL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs

Related

node js npm package installation not completed

I try to install node js npm packages, but It start to install and unfortunately freezes. I also try to install angular packages and it doesn't any problem. please help to fix this issue.
node version is 12.13.1;
npm version is 6.12.1;
I tried to install packages this way
npm i html-to-xlsx
here is a result:
another installation result:
Try the following commands then re-run the command:
npm cache clean --force
npm cache verify
And make sure you are in a place with good internet connection. Sometimes this is the issue.
I found way to fix this issue. I add -g before package name
npm install -g html-to-xlsx
Everything looks good
After that I enter this path C:\Users{USERNAME}\AppData\Roaming\npm\node_modules and copy needful module into my working folder

I get an error that stops during npm install

I get an error that stops during npm install.
error message is
: extract:run-sequence: verb lock using /Users/user/.npm/_locks/staging-19ba47088a6e1908.lock for /Users/user/Desktop/folder_name/node_modules/.staging
node v10.16.3
npm v 6.9.0
What's the problem? 😭
I updated npm and deleted the node_modules directory, and then run npm install, after which it solved this problem. It appears that killing the npm installation process using CTRL + C is causing the locking.
Try out the following steps I carried out and which worked for me.
Delete node_modules and package-lock.json file.
run npm cache clean -f to remove cached data.
Update npm using npm update -g.
try running npm install
If issue persist try changing your service provider. It can be an issue with proxy related with the provider. Or try using a Virtual Private Network (VPN) instead.

NPM pulls corrupted packages from Verdaccio instance

When I perform a basic npm install in an application I am attempting to set up a dev. environment for corrupted packages end up being pulled from my Verdaccio proxy instance.
To Reproduce
Steps to reproduce the behavior:
Set up package.json for my project including adding my dependencies,
etc.
Set my local system to use my Verdaccio instance: npm set
registry [[Verdaccio Server URL]]:4873.
Perform npm install within the directory I have the package.json in.
Results
I get a ton of output similar to the following:
npm http fetch GET 200 [[Proxy NPM Site]]/#angular%2fplatform-browser-dynamic/-/platform-browser-dynamic-5.2.11.tgz 6430ms
npm WARN tarball tarball data for #angular/router#5.2.11 (sha512-NT8xYl7Vr3qPygisek3PlXqNROEjg48GXOEsDEc7c8lDBo3EB9Tf328fWJD0GbLtXZNhmmNNxwIe+qqPFFhFAA==) seems to be corrupted. Trying one more time.
npm WARN tarball tarball data for jquery#3.3.1 (sha512-Ubldcmxp5np52/ENotGxlLe6aGMvmF4R8S6tZjsP6Knsaxd/xp3Zrh50cG93lR6nPXyUFwzN3ZSOQI0wRJNdGg==) seems to be corrupted. Trying one more time.
npm WARN tarball tarball data for ng-bootstrap#1.6.3 (sha1-1B/UIVTAWTQiy4PEc6OCiqdSW/U=) seems to be corrupted. Trying one more time.
Note the URL encoded name of the package, in this case #angular%2fplatform-browser-dynamic. I do not get this when I set my proxy to be https://registry.npmjs.org/.
Of course, what I would like to do is be able to perform an npm install just as if I were connected to the official registry.
Configuration and Log Files
verdaccio-log.txt
npm-verbose-log.txt
config.yaml.txt
Additional Information
NPM Version: Latest - 6.1.0 but it happens with older versions.
Node Version that Verdaccio is running on: 10.4.0
Node Version that Client
is running on: 10.4.0
Environment: Windows Server 2012 (SP2)
The server that Verdaccio is on is not behind a proxy.
So after performing the following everything worked as intended:
rmdir /S /Q node_modules (or rm -rf node_modules on a *nix derivative OS)
del package-lock.json (or rm package-lock.json on a *nix derivative OS)
npm set registry [[My Verdaccio Instance's IP]]:4873
npm cache clean --force
npm install --force --verbose --no-bin-links
If you roll back to NPM version 3, it will start working again. Publishing to Verdaccio with NPM#3 and then pulling with NPM#>=5 was causing this problem for me.
I solved my issue with the following steps:
remove package-lock.json
run npm cache clear --force
run npm cache verify
run npm install
This seems like a problem with your node/npm and not with Angular CLI.
I suggest you try to use
npm cache clear --force
npm install
Thanks.
Had to turn off Verdaccio's cache
uplinks:
npmjs:
url: https://registry.npmjs.org/
cache: false
Removing the package-lock.json. It solved my problem.

Not able to install #angular/cli using npm

I am new to "#angular/cli", I have tried every thing but could not install.
I am tired now please some one can help me to install angular 4 "#angular/cli" in my system.
node and npm Version
and when I am installing "npm install -g #angular/cli" then getting
after installing node -v 6 I am getting below erorr
please suggest me where actually I am wrong.
My friend,
Please try: npm cache clean --force. Maybe your npm cache got confused.
It could be issue with your node version. I will suggest you to reinstall node and try it again.
Or you can also try to clean node cache of using npm cache clean --force
List of Npm registry
https://registry.npmjs.org/ (Dfault One)
https://r.cnpmjs.org/
https://registry.npm.taobao.org/
https://registry.nodejitsu.com/
https://skimdb.npmjs.com/registry
To switch just type
npm config set registry "https://registry.npmjs.org/"
Replace the registry url with the above urls check which one works for you.
I am from india so i used https://r.cnpmjs.org/ and the same error got resolved.
Note: Please use npm cache clear (To clear cache ) and npm cache verify (To verify its clear or not), This Method works for me
Changing Registry location worked for me .
Using :
npm config set registry "https://registry.npmjs.org/"
few warnings but meh! life's too short for warnings.(Every thing is working fine BTW)
It is possible your npm cache has a corrupted file, perhaps it partially downloaded something and then got an error. Try npm cache clean --force and see if that helps.
If that doesn't help look in the log file given in the error message. Find the unexpected end of JSON input message in the log file and look before it to see if there are any other hints to the problem.
You updated your question with a new error message. That one is more specific about the corrupted file. Try removing the cli-1.5.5.tgz file from the path specified and try again. If you are using a web proxy on your network then it is also possible that your proxy has stored a corrupted cache: if you are able then turn off any proxies configured for your system and try a direct download.
Perhaps you are missing space- npm install -g #angular/cli#latest
1) Install node.js and check and node -v in command prompt. (Node.js
through website).
2) npm install -g #angular/cli#latest (run in command prompt).
Refer this link for further help
https://github.com/angular/angular-cli
3) Check node -version
4) Check npm -version
5) check ng -version
If already installed, then uninstall it and install again,
npm uninstall -g #angular/cli
npm cache clean
Both the CLI and generated project have dependencies that require Node 6.9.0 or higher, together with NPM 3 or higher.
Try using different Node version.
First try updating NodeJS(8.9.3) and npm(5.6.0). These are the LTS versions. For Node this can be important! If that doesn't work, follow this installation guide for windows.
Make sure you are not connected to VPN while installation is on.
Also, please cleanup your node_modules folder before your next try. I use the command rimraf node_modules to remove this directory in windows.
Lastly try running npm install -g #angular/cli#latest
run npm install -g #angular/cli#latest in command prompt as an admin.
right click the windows button, click on command propmt (Admin) or windows power shell(Admin) depending on your windows version. Then type the command and run it.
Most times, you could get issues when you want to install as a normal user considering the fact that you are using the -g (global) flag.
We too have the same kind of issue with user login then we tried from Administrator login its worked for us. Please do the same it may fix for you too.
Please try running:
rm -rf node_modules package-lock.json
And this,
npm install
If it still does not work, try to manually install cli:
npm install --save-dev #angular/cli
When an npm package is published, the publishing process generates a checksum that npm uses at install time to verify that the package didn't get corrupted in transit.
I had the exact same problem, while i was working in a client site, so the problem could be not your environment, they may have a proxy that needs to be configured, in my case we had a nexus server we were going through, and it has something wrong, but when i started using npm registry directly everything worked fine, but most of the time it's a cache problem, to be sure of that you should run:
npm doctor
you will probably find where is the issue.
if not please post the result maybe i can help.
Make sure your console is running as Admin,
Reinstall node & npm
Reinstall angular/cli
Most probable issue is with npm cache. Just clean your npm cache by command
npm cache clean --force
It should work well.
Uninstall your node package. And try the following
Install the latest node package from
https://nodejs.org/en/download/
Check your node and npm version by
node -v
npm -v
Now install the Angular latest version by
npm install -g #angular/cli
Check the angular version by
ng v
Now start creating your application from
https://angular.io/guide/quickstart
So I'm working with Hyperledger which requires you to have a certain Node version 8 and therefore you cannot use the newest angular installation. Perhaps I can recommend another alternative?
cd into the directory
npm install
npm start
You can also clean your npm cache but if one way doesn't work, try the other.
Try navigating to /usr/local/bin and :
if check if the file named ng is present over there, if yes then
rm -r ng and it will remove that file.
Then you can try sudo npm i -g #angular/cli#latest
And it will be a successful install.
(Writing this for those who might also face this issue in future)
Npm cache clean --force
Then install npm
Then go for angular
Npm I -g #angular/cli
was having a similar issue while installing angular cli using npm.
this was resolved by running:
npm cache clean --force
It happened to me once, looked like I had to specify the version of angular cli:
https://github.com/angular/angular-cli/issues/11589
e.g.:
npm install -g #angular/cli#1.5.0
It could be issue with your node version. I will suggest you to reinstall node and try it again.
Or you can also try to clean node cache of using npm cache clean --force
Please check this also Perhaps you are missing space- npm install -g #angular/cli#latest

When I run `npm install`, it returns with `ERR! code EINTEGRITY` (npm 5.3.0)

I am getting this error while running sudo npm install. On my server, npm was installed earlier. I've tried to delete the package-lock.json file, and ran npm cache clean --force, but it didn't work.
My npm version is 5.3.0.
The error:
npm ERR! code EINTEGRITY
npm ERR! sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA== integrity checksum failed when using sha512: wanted sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA== but got sha512-WXI95kpJrxw4Nnx8vVI90PuUhrQjnNgghBl5tn54rUNKZYbxv+4ACxUzPVpJEtWxKmeDwnQrzjc0C2bYmRJVKg==. (65117 bytes)
npm ERR! A complete log of this run can be found in:
npm ERR! /home/ubuntu/.npm/_logs/2017-11-29T05_33_52_182Z-debug.log
See https://github.com/npm/npm/issues/16861
This worked for me:
npm cache verify
Then I re-ran:
npm install -g create-react-app
And it installed as expected: Issue resolved.
Other solutions mentioned in the GitHub issue include:
npm cache clean --force
OR
Deleting npm and npm-cache folders in Users%username%\AppData\Roaming (Windows 7 and Windows 10) and running npm install
OR
Update npm by via npm i -g npm
OR
Delete package-lock.json
OR
npm cache clean
OR
Do these steps to fix the problem:
Find all outdated packages and update theme:
npm outdated -g
sudo npm i -g outDatedPKG
Upgrade npm to latest version with:
sudo npm i -g npm
Delete package-lock.json file.
Delete _cacache directory in ~/.npm:
npm cache verify
Every time I get that error, do steps 2 & 3.
If you still get the error, clear npm's cache:
npm cache clean --force
OR
Add proxy to .npmrc in ~ directory:
proxy=http://localhost:8123
https-proxy=http://localhost:8123
Try again! slow internet connection and censorship may cause this ugly problem.
OR
npm cache clear --force && npm install --no-shrinkwrap --update-binary
OR
npm config set package-lock false
Delete package-lock.json file and then try to install
The issue was indeed in package-lock.json, and after replacing it with a working version from another branch it worked.
What's interesting is seeing the diff:
So there really is some integrity checksum in the package-lock.json and it was replaced in our package-lock.json with a SHA1 instead of a SHA-512 checksum. See here for more info.
In case you don't have a working version in another branch. Consider the message
npm ERR! code EINTEGRITY
npm ERR!
sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==
integrity checksum failed when using sha512: wanted
sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==
but got
sha512-WXI95kpJrxw4Nnx8vVI90PuUhrQjnNgghBl5tn54rUNKZYbxv+4ACxUzPVpJEtWxKmeDwnQrzjc0C2bYmRJVKg==
. (65117 bytes)
Find the package in package-lock.json using the first checksum:
sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==
and put the third checksum into its "integrity" field:
sha512-WXI95kpJrxw4Nnx8vVI90PuUhrQjnNgghBl5tn54rUNKZYbxv+4ACxUzPVpJEtWxKmeDwnQrzjc0C2bYmRJVKg==
A more detailed description is here.
Actually the above is related to the network connectivity in side the server. When I've good connectivity in the server, the npm install gone good and didn't throw any error
My problem was 2 things:
Bad package-lock.json file
The existance of npm-shrinkwrap.json together with the package-lock.json file
What i did is:
Deleted the package-lock.json file
Delete the npm-shrinkwrap.json file
Ran npm install again (which recreated a good package-lock file)
Fixed my error!
I was stuck at this for a long time and this is what helped me.
Try this:
npm cache clean --force
npm install --update-binary --no-shrinkwrap
Found this answer after digging into GitHub issues!!
As a workaround, follow the below steps:
Go to the project directory
Remove the node_modules directory: rm -rf node_modules
Remove package-lock.json file: rm package-lock.json
Clear the cache: npm cache clean --force
Run npm install --verbose
If after following the above steps still the issue exists then please provide us the output of installation command with --verbose.
There are several valid and helpful responses here, but I would like to add that in my case the simplest solution was:
Delete package-lock.json;
Remove folder AppData\Local\npm\cache or AppData\Roaming\npm\cache;
Remove folder node_modules.staging;
Run npm install again.
After that everything ran smoothly.
I had a very similar problem, and in my case it worked by doing:
npm clean
This is the nuclear option since it clears every package from the cache as expained here.
Try the following:
npm cache clean --force
This has worked for me.
This Worked for me .
open the project in CMD
the run
npm cache verify
npm install
npm start
I was using private npm registry and trying to install private npm module. Logging to npm local registry fixed it (used command npm --add-user)
SherylHohman's answer solved the issue I had, but only after I switched my internet connection. Intitially, I was on the hard-line connection at work, and I switched to the WiFi connection at work, but that still didn't work.
As a last resort, I switched my WiFi to a pocket-WiFi, and running the following worked well:
npm cache verify
npm install -g create-react-app
create-react-app app-name
Hope this helps others.
I am behind my organization's proxy, running the following commands fixed the issue for me
npm config set proxy http://proxy.yourproxydomain.com:port
npm config set https-proxy http://proxy.yourproxydomain.com:port
npm config set strict-ssl false
npm config set registry https://registry.npmjs.org/
Updating .npmrc and the registry to https:// worked for me
registry=https://registry.npmjs.org/
This was not yet mentioned but make sure that your SYSTEM TIME is correct. If it is too out of sync it will cause a EINTEGRITY error. When you are doing npm publish / install.
None of the above answers worked for me. The solution to my issue was to change the way the snapshot dependency was consumed inside the package.json. Use the following template to pull in the snapshot dependency that you need
"dependency": "git+http://github.com/[pathtoproject].git#[branchname]",
I had the same issue. I used yarn instead of npm to install the dependencies and it worked.
yarn add *****
After going through all the answers and executing most of them. Although I resisted to try the Restart magic, eventually, the issue is solved after restart on my macbook(MacOS Catalina Ver. 10.15.7).
It seems like a cache issue indeed but none of the commands that I have executed cleared the cache.
What worked for me was npm cache verify then re-run your command. All should be good.
Updating the .npmrc files' entries for scoped and un-scoped packages worked for me.
So I ended up using the
npm config set #scope_name:registry SCOPED_REGISTRY_URL
and
npm config set registry PUBLIC_REGISTRY_URL
You should check Connection-specific DNS Suffix when type “ipconfig” or “ifconfig” in terminal
I faced same issue. Plus while I was trying to resolve from picking solutions from other devs, I faced few more issues like one listed here.
Angular 9 ng new myapp gives error The Schematic workflow failed
https://medium.com/#codewin/npm-warn-deprecated-request-2-88-2-b6da20766fd7
Finally after trying cache clean and verify and reinstall node of different versions and npm update, nvm and many other solution like set proxy and better internet connection, I still could not arrive to a resolve.
What worked for me is : I browsed a bit inside my C:\Users--- folder, I found package-lock.json and .npmrc files. I deleted those and reinstalled angular and tried. npm install and uninstall of different modules started working.
Before i was running this command
npm install typescript -g
after changing the command it worked perfectly.
npm install -g typescript
I faced this issue. It was my network connectivity. I changed network (from Broadband WiFi to 4G WiFi) and tried. It worked.
My broadband ISP was blocking all http requests. That might be the reason I guess in my case.
all solutions failed for me till i checked router settings; it was set to only IPV4.. i changed and put ipv4v6 and all is working fine now.
In my case the sha command was missing from my linux distro; steps were
added the packages for sha512 (on my distro sudo apt install hashalot)
npm cache verify
rm -rf node_modules
npm install
Easy and fast fix for me was to npm install the specific package on which it said the sha is wrong. Say your package is called awesome-package.
My solution was:
npm i awesome-package
This updated my sha within the package-lock.json.
If none of the above solved your problem, then just upgrade your npm verion and try. It worked for me.
Updating nodejs version worked for me.
curl -fsSL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs

Resources