-
Notifications
You must be signed in to change notification settings - Fork 12.2k
Troubleshooting npm installation
Font Awesome supports the following package managers:
- npm
- classic yarn (1.x)
- modern yarn (2.x+)
Repository | Public | Require active Pro subscription | Font Awesome Pro | Font Awesome Free |
---|---|---|---|---|
https://npm.fontawesome.com |
❌ | ✅ | ✅ | ✅ |
https://registry.yarnpkg.com |
✅ | ❌ | ❌ | ✅ |
https:/registry.npmjs.org |
✅ | ❌ | ❌ | ✅ |
Note: To use the private npm repo, an active subscription to Font Awesome Pro is required.
Use the following commands to get configuration information for your package manager:
- npm:
npm config list
- classic yarn:
yarn config list --verbose
- modern yarn:
yarn config --why
(pay attention tonpmScopes
entry)
If your application needs to use the private repository, ensure that credentials are set:
; "user" config from /path/to/.npmrc
# ...
@fortawesome:registry = "https://npm.fontawesome.com/"
//npm.fontawesome.com/:_authToken = (protected)
verbose 0.100133333 Found configuration file "/path/to/.npmrc".
# ...
'@fortawesome:registry': 'https://npm.fontawesome.com/',
'//npm.fontawesome.com/:_authToken': FONT-AWESOME-PACKAGE-FONT-AWESOME-PACKAGE-TOKEN,
➤ YN0000: npmScopes undefined, /path/to/.yarnrc.yml Map(1) { 'fortawesome' => Map(6) { 'npmAlwaysAuth' => true, 'npmAuthIdent' => null, 'npmAuthToken' => '********', 'npmAuditRegistry' => null, 'npmPublishRegistry' => null, 'npmRegistryServer' => 'https://npm.fontawesome.com/' } }
# ...
It is recommended to store the token in an environment variable in order to avoid to commit it in a public repository.
Make sure that the environment variable is available and readable by the package manager, this may be the cause of authentication issues on remote servers.
If your application needs to use the Public Repository, ensure that the above configuration is not set.
When switching from the Private Repository to the Public Repository, remove the currently installed Font Awesome packages from the lock file. The specific command to do this depends on the package manager you are using (yarn
or npm
).
It is recommended to use per-project npm configuration.
If a global configuration is provided for Font Awesome Pro, it is possible to use per-project configuration for projects that require Font Awesome Free, so that the lock files are not overwritten with references to the Private npm Repository.
# per-project configuration example for `yarn` to force the usage of the Public Repository
@fortawesome:registry=https://registry.yarnpkg.com