Font-awesome: NPM Install problem

Created on 20 Aug 2018  路  22Comments  路  Source: FortAwesome/Font-Awesome

when i try use

npm i --save @fortawesome/fontawesome-free

i receive

npm i --save @fortawesome/fontawesome-free
npm ERR! code E401
npm ERR! 401 Unauthorized: @fortawesome/fontawesome-free@latest
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Everton\AppData\Roaming\npm-cache\_logs\2018-08-20T17_06_15_744Z-debug.log

Logs:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\laragon\\bin\\nodejs\\node-v8\\node.exe',
1 verbose cli   'C:\\Users\\Everton\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'i',
1 verbose cli   '--save',
1 verbose cli   '@fortawesome/fontawesome-free' ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session c562cf7888196e85
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 401 https://npm.fontawesome.com/@fortawesome%2ffontawesome-free 1245ms
8 silly fetchPackageMetaData error for @fortawesome/fontawesome-free@latest 401 Unauthorized: @fortawesome/fontawesome-free@latest
9 timing stage:rollbackFailedOptional Completed in 5ms
10 timing stage:runTopLevelLifecycles Completed in 3955ms
11 verbose stack Error: 401 Unauthorized: @fortawesome/fontawesome-free@latest
11 verbose stack     at fetch.then.res (C:\Users\Everton\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\lib\fetchers\registry\fetch.js:42:19)
11 verbose stack     at tryCatcher (C:\Users\Everton\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
11 verbose stack     at Promise._settlePromiseFromHandler (C:\Users\Everton\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:512:31)
11 verbose stack     at Promise._settlePromise (C:\Users\Everton\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:569:18)
11 verbose stack     at Promise._settlePromise0 (C:\Users\Everton\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:614:10)
11 verbose stack     at Promise._settlePromises (C:\Users\Everton\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:693:18)
11 verbose stack     at Async._drainQueue (C:\Users\Everton\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:133:16)
11 verbose stack     at Async._drainQueues (C:\Users\Everton\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:143:10)
11 verbose stack     at Immediate.Async.drainQueues (C:\Users\Everton\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:17:14)
11 verbose stack     at runCallback (timers.js:810:20)
11 verbose stack     at tryOnImmediate (timers.js:768:5)
11 verbose stack     at processImmediate [as _immediateCallback] (timers.js:745:5)
12 verbose cwd C:\laragon\www\mv
13 verbose Windows_NT 6.1.7601
14 verbose argv "C:\\laragon\\bin\\nodejs\\node-v8\\node.exe" "C:\\Users\\Everton\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "i" "--save" "@fortawesome/fontawesome-free"
15 verbose node v8.11.3
16 verbose npm  v6.4.0
17 error code E401
18 error 401 Unauthorized: @fortawesome/fontawesome-free@latest
19 verbose exit [ 1, true ]

How to solve this?

Most helpful comment

For those that have this problem. Its not only the local .npmrc file that is in effect here.

Make sure your ~/.npmrc file doesnt contain @fortawesome:registry=https://npm.fontawesome.com/

All 22 comments

Hi!

Thanks for being part of the Font Awesome Community.

Are you a Font Awesome Pro user? Could you please check that your .npmrc does not contain @fortawesome:registry=https://npm.fontawesome.com/?

i am not a pro user, i try add this in my .npmrc but no success

i am not a pro user, i try add this in my .npmrc but no success

Please don't. You should make sure that you don't have that line.

Does not work with or without this config =(

solved, my npm install in windows make two files npmrc i remove that line and solve problem!

For those that have this problem. Its not only the local .npmrc file that is in effect here.

Make sure your ~/.npmrc file doesnt contain @fortawesome:registry=https://npm.fontawesome.com/

I am a Pro user do you have a link on what my .npmrc file should have in it?

I am using the free version and have a similar issue after running

yarn add @fortawesome/free-solid-svg-icons

I get

error An unexpected error occurred: "Couldn't find package \"@fortawesome/fontawesome-svg-core\" on the \"npm\" registry.".

I checked the .npmrc file and it does not have the line @fortawesome:registry=https://npm.fontawesome.com/, mentioned by @tagliala .

Does anyone know what else could be the problem?

I am a pro user and try to configure .yarnrc as below, but it is not working. What am I doing wrong here.

"@fortawesome:registry" "https://npm.fontawesome.com/"
"//npm.fontawesome.com/:_authToken" "XXXXX-my-token"

Error:

Error

@parth7676 please try with .npmrc, even if you are using yarn

I have a Pro account but the project I am working is only using the free icons. Seems that once you set the npm config on your machine font awesome is expecting every project to have an .npmrc file??

Describe the bug
Yarn install fails on fontawesome pro package. It has first occured on 23-Jul-2019 13:27:39.

error An unexpected error occurred: "https://npm.fontawesome.com/@fortawesome/fontawesome-pro/-/fontawesome-pro-5.9.0.tgz: Request failed \"401 Unauthorized\"".

To Reproduce
This is my .npmrc and relevant portion of package.json

.npmrc

@fortawesome:registry=https://npm.fontawesome.com/
//npm.fontawesome.com/:_authToken=XXXXX-XXXXX-XXXXX-XXXXXX

package.json

"@fortawesome/fontawesome-pro": "^5.9.0",
"@fortawesome/fontawesome-svg-core": "^1.2.15",
"@fortawesome/free-brands-svg-icons": "^5.7.2",
"@fortawesome/free-regular-svg-icons": "^5.7.2",
"@fortawesome/free-solid-svg-icons": "^5.7.2",
"@fortawesome/pro-light-svg-icons": "^5.9.0",
"@fortawesome/pro-regular-svg-icons": "^5.9.0",
"@fortawesome/pro-solid-svg-icons": "^5.9.0",
"@fortawesome/react-fontawesome": "^0.1.4",

Expected behavior
installation of packages to not fail and not stop the build.

  • [ ] SVG with JS
  • [ ] Web Fonts with CSS
  • [ ] SVG Sprites
  • [ ] On the Desktop
  • [X] npm package for use with react

@stuartcusackie if you have different projects and just some of them uses FA Pro, you can use per-project .npmrc instead of a global one

You can do the opposite if you need FA Free in just some of them

ie:

@fortawesome:registry=

should reset the registry to the default one (registry.npmjs.org for npm, registry.yarnpkg.com for yarn). Please also delete your lockfile before running npm install or yarn install with the new repo setting

@skrln

Sorry, cannot replicate.

Could you please double check that your .npmrc is a proper copy&paste from https://fontawesome.com/how-to-use/on-the-web/setup/using-package-managers#installing-pro ?

It looks like that the token is not working. If you still have problems, please send an email to [email protected]

For those still encountering this issue, here's a solution (with an explanation at the end):

Create or edit your .npmrc to include:

@fortawesome:registry=

Delete your existing .lock file. Rebuild it.

It should now work.

The reason 401 happens is probably due to other projects using one or more FontAwesome Pro licenses. That is is set globally in npmrc, so any future use of FontAwesome (including free) will assume a pro license, which you don't have. Replacing the npmrc to tell it to use the package manager's registry instead and rebuilding the lock file ensures that all your checksums point to that registry instead.

Can someone explain "the why?" In other words, why is it that we no longer need to have that line in our rc file?

Make sure your ~/.npmrc file doesnt contain @fortawesome:registry=https://npm.fontawesome.com/

At one time or another we _did_ have to have the line. So it would be helpful to understand what caused this change in behavior.

For anyone checking this for Yarn.
Note that yarn.lock contain the PRO url:

  resolved "https://npm.fontawesome.com/@fortawesome/...

That's the reason that adding or removing the registry from the .npmrc file doesn't change anything.

You can either delete the .lock file (as Kalifax mention), or if you prefer to keep your .lock file as is, you can remove the FortAwesome packages, and reinstall them (without the registry in .npmrc )

i am not a pro user, _i try add this in my .npmrc but no success_

Please don't. You should make sure that you don't have that line.

Please can you explain more about it,
It will help me to solve my issue.

Thanks.

saya bukan pengguna pro, _saya coba tambahkan ini di .npmrc saya tetapi tidak berhasil_

Tolong jangan. Anda harus memastikan bahwa Anda tidak memiliki garis itu.

Tolong bisakah Anda menjelaskan lebih lanjut tentang ini,
Ini akan membantu saya untuk menyelesaikan masalah saya.

Terima kasih.

I have the same problem, because I am not a pro user

PS C:\Userssh\Desktop\Bootstrap4\Fusion> npm install [email protected] --save
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/font-awsome - Not found
npm ERR! 404
npm ERR! 404 '[email protected]' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Userssh\AppData\Roaming\npm-cache_logs\2020-07-2T23_28_02_039Z-debug.log

.npmrc file is empty currently. Any solutions?

PS C:\Userssh\Desktop\Bootstrap4\Fusion> npm install [email protected] --save
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/font-awsome - Not found
npm ERR! 404
npm ERR! 404 '[email protected]' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Userssh\AppData\Roaming\npm-cache_logs\2020-07-2T23_28_02_039Z-debug.log

.npmrc file is empty currently. Any solutions?

Same problem......

@sakshisaxena12 @brunocouty

Please notice that we do not have any official 4.7.0 official npm package for Font Awesome.

The only supported packages have been released in the @fortawesome scope and are related to version 5

Ref: https://fontawesome.com/how-to-use/on-the-web/setup/using-package-managers

--

I'm going to lock this issue, because it has been closed by the author because it was related to a misconfiguration of .npmrc. https://github.com/FortAwesome/Font-Awesome/issues/13794#issuecomment-414455948

If you have new issues with npm, please

  1. Read the documentation
  2. Fill our bug report template

馃敀

Was this page helpful?
0 / 5 - 0 ratings

Related issues

douglasdeodato picture douglasdeodato  路  3Comments

ufoczek picture ufoczek  路  3Comments

seppestas picture seppestas  路  3Comments

AndersDK12 picture AndersDK12  路  3Comments

ghost picture ghost  路  3Comments