I work for a Company where our Frontend Build are on a Server with a very strict firewall policy
Therefore we use a Proxy (Nexus3) for https://registry.npmjs.org which works great.
Now i want to do the same for Fontawesome Pro 5
Fontawesome tells me to add those two lines in my .npmrc file see:
https://fontawesome.com/how-to-use/on-the-web/setup/using-package-managers
#fortawesome:registry=https://npm.fontawesome.com/
//npm.fontawesome.com/:_authToken=${FONTAWESOME_NPM_AUTH_TOKEN}
my old npmrc file had this line
registry=https://nexus.mycompany.com/repository/npm-proxy/
i tried the following:
registry=https://nexus.mycompany.com/repository/npm-proxy/
#fortawesome:registry=https://nexus.mycompany.com/repository/fontawesome/ <!-- which i created on the nexus side-->
//nexus.mycompany.com/repository/fontawesome/:_authToken=${FONTAWESOME_NPM_AUTH_TOKEN}
but it doesn't work and i dont know if i need a diffrent setting on the nexus side or a diffrent setting on the npmrc side...
We do have the same issue and we're asking the corresponding teams to add the Font Awesome Pro URL to the allowed list in the Firewall.
Related
I have an Expo managed react native application. I created my .env file in the root of my project, installed react-native-dotenv and set up babel to use it. After a while I managed to get it to work.
I have my environment variable
ENDPOINT=http://127.0.0.1:8000/api
and i use it with
process.env.ENDPOINT
After a while I decided to test the android version of the app, so i changed the endpoint url to my LAN ip and restarted the server. The problem is that even after restarting the server, the cache and the computer, when I call process.env.ENDPOINT it keeps the first url I set.
Here's a list of the things i tried:
restarting the server
restarting the server and the cache
restarting the whole computer
change the variable name to REACT_APP_ENDPOINT as many suggested (I get undefined, it's still stuck to ENDPOINT)
empty expo cache
The strange thing is that I already changed that same variable twice (from 127.0.0.1:8000 to 127.0.0.1:8080 and back for a problem with backend) and had the same problem, but it went away by itself after a couple of minutes (and server restarts).
This time I've been trying to get it to work for 7 hours and nothing has changed.
Any idea?
I had the same issue and managed to run the app with .env changes after using the following command.
expo r -c
reference: https://github.com/goatandsheep/react-native-dotenv/issues/75#issuecomment-728055969
After a couple hundred more tests I gave up and implemented a "custom" solution, without any external library:
Switched .env files to TypeScript files (E.g. .env.development -> env.development.ts)
Set up an object named env that has all environmental variables as properties
export const env = {
VAR1: 'foo',
...
}
Imported this constant inside the application entry point (in my case App.tsx)
Inside the main constructor assign env to global.env
Use global.env instead of process.env
Not sure if this is the best practice, but solved my problem for now, works like a charm and doesn't require me to reload my application at every change. I'm a bit concerned by the security aspect of having the environment in a global variable inside a js project, so any suggestion is still welcome
I'm trying to do some work for a client, but cannot get their bigcommerce site running locally. I have installed stencil CLI (v3.1.1) and downloaded the theme from the bigcommerce dashboard (all files). from the root of the theme i ran "stencil init", then "npm i" and "stencil start".
when i run stencil start, it throws an error saying there's no config.json file.
this is the error i get
How do i generate the config.json file?
The only config file I see is config.stencil.json.
I have also tried running "stencil pull" in hopes that it would pull the config, but it throws another error: "not ok -- Error: Could not fetch active theme details for channel 1: Request failed with status code 404"
Stencil-cli version:
3.1.1
Node version:
12
NPM version:
6.14.15
OS:
mac big sur
Stencil 3.1.1 has been deprecated for some time now. I believe the current version is 3.8. As of 4 months ago, anything below 3.5 will not run (https://developer.bigcommerce.com/changelog#publications/required-stencil-cli-version-set-to-3-5-0).
If you don't have a config.json file in your project, you will need to get the one from the client's store. Try downloading their theme again. It should come through.
Edit: It is possibly the case that you need a new API token. Try making a new one for your store. Make sure the following scopes are set:
Themes: Modify
Settings & Information: Modify
Sites & Routes: Read-only (or Modify)
Documentation for creating a new API account: https://support.bigcommerce.com/s/article/Store-API-Accounts#creating
I have two npm packages that are private repositories hosted on gitlab.com under a group organization.
My first package lives well and get updated and downloaded by users of the same organisation.
To install a private scoped package, the doc says:
# Set URL for your scoped packages.
# For example package with name `#foo/bar` will use this URL for download
npm config set #foo:registry https://gitlab.example.com/api/v4/projects/<your_project_id>/packages/npm/
So my .npmrc looked like
#mygroup:registry=https://gitlab.com/api/v4/projects/<id-project-1>/packages/npm/
//gitlab.com/api/v4/projects/<id-project-1>/packages/npm/:_authToken=<token>
//gitlab.com/api/v4/projects/<id-project-2>/packages/npm/:_authToken=<token>
//gitlab.com/api/v4/packages/npm/:_authToken=<token>
Obviously, everything works fine for the first package but not for the second one.
What I can't understand is why a scoped package should refer to a unique project url?
Because of this, I can't install both of my packages: the url of my scoped packages will only be valid for one of them.
I looked at the api endpoint to return a list of my group's packages I found this:
https://docs.gitlab.com/ee/api/packages.html#within-a-group
So I updated my .npmrc to
#mygroup:registry=https://gitlab.com/api/v4/groups/mygroup/packages/npm/
//gitlab.com/api/v4/projects/<id-project-1>/packages/npm/:_authToken=<token>
//gitlab.com/api/v4/projects/<id-project-2>/packages/npm/:_authToken=<token>
//gitlab.com/api/v4/packages/npm/:_authToken=<token>
But it doesn't work.
On the group/group-id/packages route I only get gitlab infos but nothing in an npm friendly format.
How to install more than one private scoped npm package hosted under the same group?
The instance level endpoint seems answer to your situation instance-level-npm-endpoint
Using:
npm config set #mygroup:registry https://gitlab.example.com/api/v4/packages/npm/
npm config set -- '//gitlab.example.com/api/v4/packages/npm/:_authToken' "<your_token>"
You should be able to publish #mygroup/project1 & #mygroup/project2
I experienced some troubles using yarn (1.22.10) so I'll post more details here just to save couple of hours to anybody reading this.
For some unknown reasons I was able to install the package with npm but not with yarn and I got Request failed \"404 Not Found\"
I ended up by creating a .npmrc file at the root of the project (I'm working with docker) with the following content:
#my-org:registry=https://gitlab.com/api/v4/packages/npm/
//gitlab.com/api/v4/packages/npm/:_authToken=<GITLAB_TOKEN_API_SCOPE>
//gitlab.com/api/v4/projects/<ID_PROJECT_1>/packages/npm/:_authToken=<GITLAB_TOKEN_API_SCOPE>
//gitlab.com/api/v4/projects/<ID_PROJECT_2>/packages/npm/:_authToken=<GITLAB_TOKEN_API_SCOPE>
Line 3 and 4 are required for yarn but not for npm.
To make it work replace #my-org by your gitlab organisation name, gitlab.com by the url where your projects are, <ID_PROJECT_X> by the ids of the projects you want to install and <GITLAB_TOKEN_API_SCOPE> by a personal token with an API scope.
Does Create-React-App support named URLs e.g. my-app.dev as opposed to the default localhost:3000?
I am using a Windows 10 machine. I used to use an Apache virtual host to set this up but I can't figure out how to do it in CRA.
UPDATE:
I've half solved the problem by adding 127.0.0.1 www.my-app.dev my-app.dev to the hosts file located at C:\Windows\System32\drivers\etc.
I also had to create a .env file in the root of my React project and added HOST = my-app.dev
I then tried to add PORT = 0 to the .env file but that made no difference.
Now when I run the app with npm start it opens at my-app.dev:3000
Is there a way to get rid of of the port?
I have found the answer on the CRA Github page here
I installed prestashop successfully through your marketplace, and been able to play around with it and also to upload new modules. But every time i try to install the uploaded modules, i get this message
"The following module(s) were not installed properly:"
But the prestashop default modules do install without issues.
What is causing that problem? because the same modules were uploaded and installed without issues on cpanel shared web hosting?
Check modules sql commands for installation. I think module has an character issue. if u enable debugmode and display errors on config/defines.inc.php u can see where the error is.
If u cant solve.
Find this line on your module main php ( for "testmodule" its "testmodule.php") "if (!DB::getInstance()->execute(trim($query))) return false;" some think like that. And remove or close this line. But when u doing this u must manualy run modules sql code with phpmyadmin or something else after or before install module.
modules sql files usualy "install.sql" but some this coders add sql code on modules main phps.
This is a generic error and means that your module installation has failed.