简体   繁体   English

npm 错误! 404 Not Found for Private Package 在 gitLab CICD 上安装时

[英]npm ERR! 404 Not Found for Private Package while installing on gitLab CICD

I have created a private package on npm and installed on locally it's working fine.我在 npm 上创建了一个私有的 package 并在本地安装它工作正常。 During deployment of the project with GitLab CICD.在使用 GitLab CICD 部署项目期间。 I am getting this error.我收到此错误。 To resolve this I created a .npmrc file in build with access token as.为了解决这个问题,我在构建中创建了一个.npmrc文件,访问令牌为。

script:脚本:

  whoami
  echo $PATH
  source /etc/environment
  echo '//registry.npmjs.org/:_authToken=<MY_AUTH_TOKEN>'>.npmrc
  npm whoami
  npm i

Error:错误:

npm ERR! code E404
npm ERR! 404 Not Found - GET
https://registry.npmjs.org/@<MY_ORG>/<PRIVATE_PACKAGE_NAME>/-/<PRIVATE_PACKAGE_NAME>-1.0.1.tgz
npm ERR! 404 
npm ERR! 404  '@<MY_ORG>/<PRIVATE_PACKAGE_NAME>@1.0.1' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'app'
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-09-22T17_46_52_727Z-debug.log

Please help me out to fix this issue.请帮我解决这个问题。

Double-check your npm token.仔细检查您的 npm 令牌。 In your npm account profile.在您的 npm 帐户资料中。

Each npm logout actually deletes the token from your account.每次npm logout实际上都会从您的帐户中删除令牌。 (stored in global.npmrc on your machine). (存储在您机器上的 global.npmrc 中)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM