I have published a scoped npm package in an npm-local repo on Artifactory. For example let's say it's @scope/packagename in the package.json. The path it creates on Artifactory seems to have an extra @scope in the path: https://artifacts.company.com/artifactory/webapp/#/artifacts/browse/tree/General/npm-local/@scope/packagename/-/@scope/packagename-version.tgz
Is this correct? Is there a problem with the publish? This is related to another question: Installing scoped npm packages from Artifactory. When I try to install this package I just published I get a 404 error leading me to believe there might be something wrong with the path?
Edit: To publish my scoped package I edited my .npmrc:
@scope:registry=https://artifacts.company.com/artifactory/api/npm/npm-local/
//artifacts.company.com/artifactory/api/npm/npm-local/:_password=Q......
//artifacts.company.com/artifactory/api/npm/npm-local/:username=dgriner
//artifacts.company.com/artifactory/api/npm/npm-local/:[email protected]
//artifacts.company.com/artifactory/api/npm/npm-local/:always-auth=true
In my package.json file I have the following:
"name": "@scope/packagename",
I then ran npm publish
and it created the above path.
The path seems to be OK and should not lead to a resolution error.
The physical location of the NPM package does not effect the way it is being resolved. When resolving an NPM package, Artifactory is using the package metadata and not its path (as opposed to other supported package managers such as Maven which relies on the repository layout and artifact path).
As you have seen, Artifactory does have a layout for storing NPM packages. While it is not used for resolution it can be used for other concerns such as configuring fine grained access permission.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With