Cesium packages with Artifactory

Hi everyone,

I’m executing the following command against an Artifactory remote repository pointing to ‘https://unity.pkg.cesium.com/’:

npm view com.cesium.unity --registry=https://><ARTIFACTORY-DOMAIN>/artifactory/api/npm/unity-cesium/ 

But I get a 404 response with the following stack trace:
“Could not download npm metadata from .npm/com.cesium.unity/package.json with an error: Not found”

Do cesium packages have a package.json file?
Does cesium requires an Access Token?
What is the difference between ‘com.cesium.unity’ and the cesium package in npmjs?

Thank you

Hi @Jordan_Tangy, welcome to the community!

I’m moving this to the Cesium for Unity category, since it seems most relevant.

Could you please share what are you trying to do, and why you’re trying to access Cesium for Unity through npm? We host Cesium for Unity so that it may be imported via the Package Manager in Unity, so we have never tried downloading it through npm ourselves.

Hi @janine

Thank you for your response.

In the past, it was possible to use an NPM remote repository pointing to “https://unity.pkg.cesium.com/” on Artifactory to pull and view the unity package with the NPM client, for example:

npm view com.cesium.unity --registry=https://<artifactory-domain>/artifactory/api/npm/<repo-name>/ 

For some reason, it doesn’t work anymore (I didn’t upgrade Artifactory since then) and I would like to know from the community if someone is using Artifactory as well with cesium and let me know if I’m doing something wrong or if something changed on Cesium’s side and if there is an alternative.

Using the ‘npm view’ command with the cesium registry works fine, but going through Artifactory doesn’t. Here is a successful response of an ‘npm view’ command executed against the cesium registry:

Here is the stack trace of the same command executed against Artifactory:

npm view com.cesium.unity --registry=https://<artifactory-domain>/artifactory/api/npm/jordanta-unity/ --verbose


npm verbose cli /opt/homebrew/Cellar/node/22.6.0/bin/node /opt/homebrew/bin/npm
npm info using npm@10.8.2
npm info using node@v22.6.0
npm verbose title npm view com.cesium.unity
npm verbose argv "view" "com.cesium.unity" "--registry" "https://<artifactory-domain>/artifactory/api/npm/jordanta-unity/" "--loglevel" "verbose"
npm verbose logfile logs-max:10 dir:/Users/jordanta/.npm/_logs/2024-08-11T09_21_29_464Z-
npm verbose logfile /Users/jordanta/.npm/_logs/2024-08-11T09_21_29_464Z-debug-0.log
npm http fetch GET 404 https://<artifactory-domain>/artifactory/api/npm/jordanta-unity/com.cesium.unity 959ms (cache skip)
npm verbose stack HttpErrorGeneral: 404 Not Found - GET https://<artifactory-domain>/artifactory/api/npm/jordanta-unity/com.cesium.unity
npm verbose stack     at /opt/homebrew/lib/node_modules/npm/node_modules/npm-registry-fetch/lib/check-response.js:95:15
npm verbose stack     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
npm verbose stack     at async RegistryFetcher.packument (/opt/homebrew/lib/node_modules/npm/node_modules/pacote/lib/registry.js:90:19)
npm verbose stack     at async #getData (/opt/homebrew/lib/node_modules/npm/lib/commands/view.js:135:20)
npm verbose stack     at async #viewPackage (/opt/homebrew/lib/node_modules/npm/lib/commands/view.js:112:28)
npm verbose stack     at async View.exec (/opt/homebrew/lib/node_modules/npm/lib/commands/view.js:70:5)
npm verbose stack     at async Npm.exec (/opt/homebrew/lib/node_modules/npm/lib/npm.js:207:9)
npm verbose stack     at async module.exports (/opt/homebrew/lib/node_modules/npm/lib/cli/entry.js:74:5)
npm verbose statusCode 404
npm verbose pkgid com.cesium.unity@*
npm error code E404
npm error 404 Not Found - GET https://<artifactory-domain>/artifactory/api/npm/jordanta-unity/com.cesium.unity
npm error 404
npm error 404  'com.cesium.unity@*' is not in this registry.
npm error 404
npm error 404 Note that you can also install from a
npm error 404 tarball, folder, http url, or git url.
npm verbose cwd /Users/jordanta
npm verbose os Darwin 23.5.0
npm verbose node v22.6.0
npm verbose npm  v10.8.2
npm verbose exit 1
npm verbose code 1

Additionally, I’ve inspected Artifactory logs and I see that the package.json is not found:

Could not download npm metadata from .npm/com.cesium.unity/package.json with an error: Not found 

Did something changed on Cesium’s side? Is it working with the NPM client or a specific version?
Artifactory is basically forwarding the request to the registry so I’m not sure where the issue comes from.

I would appreciate someones insights please.

Thank you.

Hi @Jordan_Tangy,

Our unity.pkg.cesium.com registry is just a few hand-written static files hosted on AWS, so it’s not shocking if it somehow isn’t behaving correctly by Artifactory’s standards. As Janine mentioned, we only test it using the Unity Package Manager, and we’re not Artifactory users ourselves. We’re not aware of any changes to it, though; it has worked the same way since we originally launched it. If you identify something specific that unity.pkg.cesium.com isn’t doing correctly, let us know and we may be able to fix it.