简体   繁体   中英

install npm package from private github repository npm ERR! code ENOENT

i'm trying to install a npm package from private repository github of my organisaion with npm install, but i still have a npm ERR! code ENOENT npm ERR! code ENOENT How can i configure my npmrc to say that i would install package from a private github repository + npm package public repository ?

You need Authorize your GitHub personal access token and ensure it has the repo and read:packages scopes enabled.

echo "export GITHUB_TOKEN=your_github_token" >> ~/.zshrc
source ~/.zshrc

npm config set '//npm.pkg.github.com/:_authToken' "${GITHUB_TOKEN}"

then npm i should pass

As mentioned in previous answers you need to set a personal token within your profile so that when npm runs it will use your token.

Another option is, you can ignore the file .npmrc where you'll add your token.

registry = https://npm.pkg.github.com/company_package
//npm.pkg.github.com/:_authToken=my_token_here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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