Premium support for our pure JavaScript UI components


Post by JussiSa »

Hey,

As version 4.1.0 brought us NPM support, I'm trying to install components via npm install.
I can do it as documented, using npm login and authorizing first before installing.
What I'd like to do, is to put authorization details in project's .npmrc file and be able to install packages normally by npm install, so I wouldn't need to do npm login seperately.

I am however not able to do this. I've tried multiple combinations (putting details in .npmrc) but none of them works. Some combinations returns HTTP 501 response while some 401, unable to authenticate.

Is the configuration below correct, or am I doing something wrong? Or is this even possible?

@bryntum:registry=https://npm.bryntum.com/
//npm.bryntum.com/:username=<username>
//npm.bryntum.com/:password=<password>
//npm.bryntum.com/:email=<email>

This would help a lot, especially during automated build processes.


Post by sergey.maltsev »

Hi!

You need to authorize on machine once. This is required step.
nmp will store credentials on this machine and npm install will work than with no additional login.

Login credentials are stored in machine's user's .npmrc file.

It will have something like

@bryntum:registry=https://npm.bryntum.com
//npm.bryntum.com/:_authToken=<token-value-here>

Please check this info here https://docs.npmjs.com/cli/v7/configuring-npm/npmrc how you can use it on per project basis.


Post by JussiSa »

Thank you for the reply, we can make this work as documented.
As a feature request for the future, it would be nice to make Bryntum NPM registry to work with a single authToken. This way we could include it to project's own .npmrc -file and share it via git repo to all developers without them having to authorize their machine manually.


Post by sergey.maltsev »

Hi!

Thanks you for the suggestion.
This is a feature request issue for this.
https://github.com/bryntum/support/issues/2703


Post by sfry »

Hi

Can you explain what this change means in detail please? We are having issues connecting our Artifactory to Bryntum's npm registry and think this may be relevant in some way? In Artifactory we set the username and password for our Bryntum npm registry user, however this fails to work and allow us to proxy through Artifactory. Should I be using an access token rather than a password in the Artifactory configuration?

Thanks


Post by sergey.maltsev »

Hi!
Please check these Artifactory docs here

Advanced Settings - JFrog - JFrog Documentation

Also this info may be useful for setting up your auth
https://www.bryntum.com/docs/grid/#Grid/guides/npm-repository.md#access-tokens-for-ci%2Fcd


Post by sfry »

Thanks Sergey

Nothing I do seems to help here. I have tried with a token and with password in the Artifactory remote advanced settings.

When I use my password there I can do npm view on @bryntum/calendar and this is all good, but an install fails with a 404 on calendar-4.2.2.tgz.

The user has a license for this component in the customer portal.

Thanks

Stephen


Post by sergey.maltsev »

Hi!

Unfortunately we have no expert experience in using Artifactory so could you please give us some steps how we can reproduce this problem with Artifactory?
For example with Jfrog free could repository (https://jfrog.com/open-source/).

Basically as noted above to use token access all you need is run:

npm token create --registry=https://npm.bryntum.com

Copy displayed token to .npmrc file in project's folder where you have package.json with this format (replace <token-value-here> with copied token):

@bryntum:registry=https://npm.bryntum.com
//npm.bryntum.com/:_authToken=<token-value-here>

This will allow to run npm install from the folder with .npmrc file and install @bryntum packages.

Probably you could also consult with Jfrog support team for more details.


Post by sfry »

Hi

In Artifactory we are creating a remote repository with the following settings.

On the Basic tab we have set

URL: https://npm.bryntum.com

On the Advanced tab we have set

Username: <user registered email with @ replaced with ..>
Password: <tried Bryntum password and also tried the generated token>

All other settings left as defaults.

This remote repository is then added to a virtual Artifactory repository, and then this is the one set in our .npmrc file for the end user.

Regards

Stephen


Post by sergey.maltsev »

Hi!

I've created remote repository for @bryntum in Artifactory's admin panel, then added it to virtual repo there.

Now the question is what is exactly in the project's directory where you check installing of packages from Artifactory repo?

I expect .npmrc file there with the credentials for Artifactory repo (not Bryntum). Right?

And what is inside package.json?

If I use something like this:

  "dependencies": {
    "@bryntum/grid": "4.2.2"
  }

That it works only if I set credentials for Bryntum in .npmrc, but it is not the way it should be.

May be you could attach sample project here or post me in PM with the zip if you have any sensitive data there.

Do we need some CLI tool for Artifactory to setup repo and install packages?
Again sorry because Artifactory is not used here by us, so need a bit more data to proceed and check what's going on.


Post Reply