Hello colleagues,
we have a private npm repository in artifactory and published a package to it. It is working fine with console commands to get the package. Now we are trying to use scoped registries to get it in Unity project from there. We set our package as a dependency in the manifest.json and added the scopedRegistries. I added the manifest.json at the end.
We are using the Unity 2019.3.0f1.
But the following error message occurs, pointing to an authentication problem:
An error occurred while resolving packages:
One or more packages could not be added to the local file system:
com.company.test: Request [GET https://{SERVERADDRESS}/artifactory/api/npm/{REPO-NAME}/com.company.test/-/com.company.test-0.1.0.tgz] failed with status code [401]
I tried to change the url in the manifest to “http:\{USER}:{PASSWORD}@{SERVERADDRESS}/artifactory/api/npm/{REPO-NAME}/”, but this results in the same error.
Is it possible to use an npm repository with authentication? If it is, can you point me to instruction on how to do it.
Thank you and best regards,
Meik
{
"scopedRegistries": [
{
"name": "Main",
"url" : "https://{SERVERADDRESS}/artifactory/api/npm/{REPO-NAME}/",
"scopes": [
"com.company.test"
]
}
],
"dependencies": {
"com.unity.collab-proxy": "1.2.16",
"com.unity.ide.rider": "1.1.0",
"com.unity.ide.vscode": "1.1.3",
"com.unity.test-framework": "1.1.3",
"com.unity.textmeshpro": "2.0.1",
"com.unity.timeline": "1.2.6",
"com.unity.ugui": "1.0.0",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",
"com.unity.modules.animation": "1.0.0",
"com.unity.modules.assetbundle": "1.0.0",
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.cloth": "1.0.0",
"com.unity.modules.director": "1.0.0",
"com.unity.modules.imageconversion": "1.0.0",
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.particlesystem": "1.0.0",
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.physics2d": "1.0.0",
"com.unity.modules.screencapture": "1.0.0",
"com.unity.modules.terrain": "1.0.0",
"com.unity.modules.terrainphysics": "1.0.0",
"com.unity.modules.tilemap": "1.0.0",
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.uielements": "1.0.0",
"com.unity.modules.umbra": "1.0.0",
"com.unity.modules.unityanalytics": "1.0.0",
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.unitywebrequestassetbundle": "1.0.0",
"com.unity.modules.unitywebrequestaudio": "1.0.0",
"com.unity.modules.unitywebrequesttexture": "1.0.0",
"com.unity.modules.unitywebrequestwww": "1.0.0",
"com.unity.modules.vehicles": "1.0.0",
"com.unity.modules.video": "1.0.0",
"com.unity.modules.vr": "1.0.0",
"com.unity.modules.wind": "1.0.0",
"com.unity.modules.xr": "1.0.0",
"com.company.test": "0.1.0"
}
}