Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Publish scoped npm package to Artifactory Online

I'm trying to publish a scoped npm package to Artifactory Online: my-company.jfrog.io/my-company

I'm experiencing the same problem described in this SO Question where I publish my package @scope/my-package and it deploys to Artifactory just fine but it winds up in the Artifactory Online path: npm-internal/@scope/my-package/-/@scope/my-package-1.2.3.tgz

When I run npm view @scope/my-package I get the 404 error:

npm ERR! 404 Not Found: @scope/my-package

In Artifactory, packages can be moved, and so I tried moving it from:

npm-internal/@scope/my-package/-/@scope/my-package-1.2.3.tgz

to

npm-internal/@scope/my-package-1.2.3.tgz

and try npm view @scope/my-package, get package details, and can perform an npm install @scope/my-package to install it.

Every answer I've found online has a solution to configure Tomcat to AllowEncodedSlashed. Is there an Artifactory Online equivalent?

I've rummaged through as much of the web app as I can think to rummage through to find anything resembling a configuration option to allow this to work and found nothing. I haven't found anything searching the docs.

like image 937
nwayve Avatar asked Nov 22 '25 00:11

nwayve


1 Answers

According to artifactory docs:

There are two ways to deploy packages to a local repository:

  • Edit your package.json file and add a publishConfig section to a local repository: "publishConfig":{"registry":"http://localhost:8081/artifactory/api/npm/npm-local/"}

  • Provide a local repository to the npm publish command: npm publish --registry http://localhost:8081/artifactory/api/npm/npm-local/

You can deploy a packed npm package to a specific path in your registry. Given this, the following can be performed:

npm run build
npm pack dist/
npm publish scope-my-package-1.2.3.tgz --registry https://my-company.jfrog.io/my-company/api/npm/internal-npm/@scope/my-package/
npm view @scope/my-package

And this works. The newly deployed package can be viewed now.

like image 103
nwayve Avatar answered Nov 24 '25 22:11

nwayve



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!