I have get below error
npm ERR! code E401
npm ERR! Unable to authenticate, need: Basic realm="https://npm.fontawesome.com/",service="npm.fontawesome.com"
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Samanthika\AppData\Roaming\npm-cache\_logs\2021-09-11T23_51_19_635Z-debug.log
In previous project I have mistakenly do the global configuration using below commands
npm config set "@fortawesome:registry" https://npm.fontawesome.com/
npm config set "//npm.fontawesome.com/:_authToken" TOKEN
@fortawesome:registry=https://npm.fontawesome.com/
//npm.fontawesome.com/:_authToken=TOKEN
I cannot install fontawesome to my new projects after do the global config bacause it gives same error. How I solve this problem?
CodePudding user response:
As an alternative, you can simply include Font Awsome CDN in the index.html file.
Go to https://fontawesome.com/start and enter your email in the given field. You will receive an email with the CDN URL and include that in the header part of the index.html.
CodePudding user response:
First, run the following command to delete the old registry.
npm config delete "@fortawesome:registry" https://npm.fontawesome.com/
Then install the required package to your project
npm install / npm install "package name"
This should solve your problem