.npmrc फाइल
.npmrc एक छोटी config file है जो बदलती है कि npm कैसे behave करता है, जैसे registry या auth tokens।
In this page:
Syntax
registry=https://registry.example.com/
save-exact=true
fund=false
.npmrc
npm project से, आपकी home directory से, और globally .npmrc पढ़ता है, project file priority लेते हुए। Common settings में registry, save-exact, और scoped registries शामिल हैं।
auth tokens वाली files कभी commit न करें; इनकी बजाय इनमें environment variables इस्तेमाल करें।
Note:
.npmrc में ${NPM_TOKEN} placeholders इस्तेमाल करें और CI में variable set करें।
उदाहरण: .npmrc
# .npmrc
registry=https://registry.npmjs.org/
save-exact=true
@mycompany:registry=https://npm.mycompany.com/
//npm.mycompany.com/:_authToken=${NPM_TOKEN}
⚠️ Run this in your own terminal or Node.js environment.
Related Topics
{# common_mistakes/chapter_summary/browser_support: on Hindi pages the
view already swaps in the hi_ translation fields (or blanks these
out if untranslated), so this renders correctly for both languages
without a lang_code check here. #}
आम गलतियां
- auth tokens commit करना
- global file edit करना जब एक project वाली intended हो
- scope-specific registries भूल जाना
चैप्टर सारांश
- .npmrc npm configure करता है
- Project file user file को override करता है
- tokens env variables में store करें
- Scopes private registries की ओर point कर सकते हैं
🔒
Chapter Quiz — Complete all 7 topics to unlock
0/7 topics done
Complete these topics first: