Package Installing from Private Gitlab Registry fails with 404

I have the same problem with this topic

The difference is, while the topic above succeed after a day, I still can’t get a success install after I added a gitlab called “CI_JOB_TOKEN” in my expo secrets.

here are my settings:
in Expo secrets: there is a secret called “CI_JOB_TOKEN” with permission to my private gitlab repo
in .npmrc, I have a registry setting:

; repoName
@myRepo:registry=https://gitlab.com/api/v4/packages/npm/
//gitlab.com/api/v4/packages/npm/:_authToken=${CI_JOB_TOKEN}
//gitlab.com/api/v4/projects/34091459/packages/npm/:_authToken=${CI_JOB_TOKEN}

in package.json, I have added a pre-install-hook: “eas-build-pre-install”: “bash ./scripts/eas-build-pre-install.sh”

in ./scripts/eas-build-pre-install.sh, I added some command to add registry:

yarn global add expo-cli
echo "@vimworldinc:registry=https://gitlab.com/api/v4/packages/npm/\n//gitlab.com/api/v4/packages/npm/:_authToken=${CI_JOB_TOKEN}" > ~/.npmrc

none of these works, please give me some help : ) Thanks !

after I deleted yarn.lock file, the error becomes

error An unexpected error occurred: “https://gitlab.com/api/v4/packages/npm//n//gitlab.com/api/v4/packages/npm/:_authToken=**************************/@vimworldinc%2Fvim-api-sdk-js: Not found”.

and after I deleted the pre-install-hook settings, the error becomes

error An unexpected error occurred: "http://10.4.1.2:4873/@myRepo%2f repoName: no such package available".
info If you think this is a bug, please open a bug report with the information provided in "/home/expo/workingdir/build/yarn-error.log".

Hi @spikewang

After you deleted yarn.lock, did you regenerate it by running yarn?

Try putting the hook back but add “cat .npmrc” as the last line of your ./scripts/eas-build-pre-install.sh so that you can see exactly what it contains and verify that it’s correct when the build is run.

It seems very difficult to find the exact solution, you can try this Gitlab’s NPM packages.