Cloudflare Pages Deployment: Yarn install fails with 401 Unauthorized for fontawesome dependency - npm

Deployments worked fine before I installed FontAwesome. Locally it works fine even with FontAwesome. But with FontAwesome dependency installed Cloudflare fails.
Console log from Cloudflare Pages:
23:32:59.378 Installing NPM modules using Yarn version 1.22.4
23:32:59.751 yarn install v1.22.4
23:32:59.851 [1/4] Resolving packages...
23:33:00.491 [2/4] Fetching packages...
23:33:00.802 error An unexpected error occurred: "https://npm.fontawesome.com/#fortawesome/free-solid-svg-icons/-/5.15.3/free-solid-svg-icons-5.15.3.tgz: Request failed \"401 Unauthorized\"".
23:33:00.802 info If you think this is a bug, please open a bug report with the information provided in "/opt/buildhome/repo/yarn-error.log".
23:33:00.802 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
23:33:23.195 Error during Yarn install
23:33:23.195 Failed: build command exited with code: 1

I just had this issue when trying build a Strapi app on DigitalOcean. I was able to fix it using this guide from the FontAwesome website.
Unfortunately, this workaround requires a valid auth token. Luckily for me, I was already an FA Pro subscriber.
Create an .npmrc file in the root of your project and add the below code, replacing "TOKEN" with your auth token. The auth token can be found on the guide linked above once logged into the FA website.
#fortawesome:registry=https://npm.fontawesome.com/
//npm.fontawesome.com/:_authToken=TOKEN
I'm not well versed enough in npm authentication to know why the free version would require this, but I'm sure there must be another workaround for free users of FA.

Related

yarn add - 403 (Forbidden)

I have published a private package in my company as #company/package-name, I can see it in our github repository.
After that, I did yarn add #company/package-name in another project and I got:
➤ YN0027: #company/package-name#unknown can't be resolved to a satisfying range
➤ YN0035: The remote server failed to provide the requested resource
➤ YN0035: Response Code: 403 (Forbidden)
➤ YN0035: Request Method: GET
➤ YN0035: Request URL: https://npm.pkg.github.com/#company%2fname
It is weird, I can publish but I cannot install it.
Do you have any idea please?
Finally I got the source of errors.
The checkbox Inherit access from source repository (recommended) was unchecked in the package settings page.
I have enabled it, and now, we can publish (also with --experimental) and also download this new package.
Thank you Trond Glomnes for your help.
Looks like yarn is causing issue. followed the below steps and that did the trick.
npm uninstall –g yarn
npm cache clean –force
npx create-react-app my-app

Gitlab NPM Registry Install 503

I have published a package to the Gitlab NPM registry and now I am attempting to install the package into another project.
When I run in terminal:
yarn add #org-name/project or npm i #org-name/project
I get (4x):
info There appears to be trouble with the npm registry (returned undefined). Retrying…
Then after the 4 attempts above in the terminal I get:
ResponseError: Request failed “503 Service Unavailable”
I have authed to Gitlab and the group as I was able to publish the package and followed each step here: https://docs.gitlab.com/ee/user/packages/npm_registry
Any ideas at all as to why I can publish but not download the same package from the same repo or any other repo??
Thank you so very much in advance!
The issue turned out to be a typo on my part. Le sigh.

while installing cypress through command :npm install cypress --save-dev getting error as The Cypress App could not be downloaded

while installing cypress through command :npm install cypress --save-dev getting error as The Cypress App could not be downloaded.
Error :
Finishing Installation
The Cypress App could not be downloaded.
Does your workplace require a proxy to be used to access the Internet? If so, you must configure the HTTP_PROXY environment variable before downloading Cypress. Read more: https://on.cypress.io/proxy-configuration
Otherwise, please check network connectivity and try again:
But please not I m not using any proxy and on my personal wifi.
plz suggest ,what can be done in this case.Thanks
It seems to be too many possible reasons for this issue in general but I managed to find a workaround to install Cypress from within a corporation with npm and without using sudo npm or turning off strict ssl.
The following worked for me per November 18th 2020 with Ubuntu 18.04 and npm 6.14.8:
I downloaded the zip file shown in https://docs.cypress.io/guides/getting-started/installing-cypress.html#Direct-download
I installed cypress as shown in https://docs.cypress.io/guides/getting-started/installing-cypress.html#Install-binary : CYPRESS_INSTALL_BINARY=~/Downloads/cypress.zip npm install cypress --save-dev
I could now run npx cypress open to start the gui (which will also generate the cypress.json file)
Possible Reasons for this issue:
U might be running the project with a proxy setting.
One of the reason could be you are behind the firewall.that may prohibit your network? Please follow the guidelines in Proxy Configuration if so(https://docs.cypress.io/guides/references/proxy-configuration.html#Set-a-proxy-on-Linux-or-macOS).
make sure you have right access to install the cypress.
if none of the above mentioned reasons try removing the biraries or node_modules and install again.

Nexus npm private registry configuration

I am using Nexus Repository ManagerOSS 3.0.2-0, I have successfully created npm hosted repository, but when I click on the link it always says 400 bad request.
And also through command line am not able to perform npm adduser pointing to this registry .
Any idea what am doing wrong?
The link in the UI is non functional, it's there to copy for use in setting up tooling, the 400 is expected behavior at this point in time.
As for npm adduser, I believe this should work. Make sure to have the npm Bearer Token Realm enabled.
You can read more about enabling it here: https://books.sonatype.com/nexus-book/reference3/npm.html#_authentication_using_realm_and_login

Cannot install some packages from npm

My computer has a strange problem. Whenever I try to install some npm packages like ionic and cordova, it fails giving some shasum check failed error.
Like this cmd snapshot:
This has happened with other packages like generator-ionic
I've also checked for proxy setups in Internet Options and Router Settings, there are none.
Also, when I try to install these packages using my phone's data connection (usb tethering) they get installed without any problems.
I am assuming there is some problem with my internet connection, but can't seem to figure out what it is.
If your network is blocking the npm repository ,You may get this error ,Please use fiddler to debug you npm is able to connect to repository