.npmrc
npm 配置文件
描述
npm 从命令行、环境变量和 npmrc
文件获取其配置设置。
npm config
命令可用于更新和编辑用户和全局 npmrc 文件的内容。
有关可用配置选项的列表,请参阅 配置。
文件
四个相关文件是:
- LEY0MtpFCteDbW9PrEbbH7g4bXn2VvQ3aoPepSgm3fBatOI84yFxgk/1iXwJgVjnZi0tZgMVWmXTbOCQruBFZE4QqUcYEQPY6bVvJB5nVZqaxSlj7R0hvKr+OE/Jet+orMS4sWG3COMT0PmVJxLJG7sm14tC7SJ/5qO6b6yoT0nk0/+NQ/NC0UmVvamCWA32A4M8l4mUBjMBKWip/c8uykmUBsxrCZGzNlCKPlyO0Mc0EV5vftxKIU4vPKXdcwxWm/YKSqqs5RphbSSQzj2YnkdSKn8TMklA4Pe2WyxMijw=
He0uMcG/kSvkLeeibE5RoM8KInTyx6AluBrMYMqW3yQJfhbKZWOmbsV/sqdb1PFypa5g+Hr6vJR2VqLK6D/Mg7QE5SIRQ7T59351sBjStMs1P7JXu16WMQYU1GE+fqtSPUJ2s8tv/5xuD9QfnfANvDTi+xrGfyYMxNR2GYTfJm3j8GWoFUA4n9vRFHnUWb5qd524tKsnPH22s9/+Bn8DiQ==
prefix = ${HOME}/.npm-packages
LXx8Kp1rH4UBwYveJunmugtIkPnP7uDutkaG8FtcyTRIAG49kwYJRvtwSjkZ8XGJc25IS6p0WsQCzFQ5arz9mpPQmCt3vcMxg/MahANr/lB39wsPlH6CKxJC9ZgZjgmO1sfiSb48L08cY7RIBJtiHi9F/zsM90a9hOd6Z0AKGZQjbKL6tI5Fw3Ns+y8HC76C01zVADBx4e+obovYvGjq3f0gZfNGSe10bH/JNgAsTXU=
1SiHT/ro6rV7A9YmSJgWuaPIDYRd0gTr/bFMWv31XvemE3CGQECZLkhvEpSvToM+HULXO0CJjEkyvdKvLEbjNw==
key[] = "first value"
key[] = "second value"
注释
0u67pEEUQCVtM5bwJ1oewoYg/H8fb6BQAmFlEBuCSxbwx30E/Yt2MNEawTpkltk7YHrYX2lWF/BJsEkf5Ek7fQv/SWaQdxA4mzzT2ApLvngX20y8FYvuS8X70ETCViAf/yXPOx7xGFFf8RgC8ra1JnWSmjqKuhYIYFNlL/Y5RdDIDKw3is6eUBMq/TppwZT/f2Y9nr7E+oNvqcoletqRFvkru1wubRUa311g2sObHVLTGRiXLvxKMTj1YB2jrHiDNxY3ycvcavkAht+IXUPpP2lV1guBPUBAvo2wdR7t3LDZbguXNyauJbYvK7x7ESkgz4IOvssdkRsCSUPcWAD0mGvem2L3SJ2nimSSIUcV/SE79H299lDkI5rszp0sEchc
i5it4iurfMMrzxvmO7gMnA==
# last modified: 01 Jan 2016
; Set a new registry for a scoped package
@myscope:registry=https://mycustomregistry.example.org
每个项目的配置文件
P1UaQJbia0ROn+P2yBf/TP0cR8I6HJjDb30R7vttTNQvClYy6aBmnpguJuypv8q5aq8zHrS+7gPiRApDPdHrtXsK4l7sCXdHcaVnGMjgzFTf9WrmXPLZ/net/3TiHKwUO8JoNcjzBKIBRfjhfhASOZOvoPw97+vUtHLTjPZoqLgA/xOTzSupNmxhvaxmBAgz5qX7nha84kS+3e9n07kHglZOLmXo4lJVuNUE3040CtavC/mDdTBBrRlnzeKP3DES/BB/r6z8am2jusAd7A/FTQ==
eMZ0b2aqqSRCAJqh7phUd7W5XIWS/abhMI1+trAssadXITNXZO6tl+Oivn17/TugkIbnu/y4ANUnmFa6MJwN5HXMduIG0eMwsWP4JjG9cex87hcAUrK+dB2Jb0ZBlweEnKnissUelgqCe7B07GOKFQOhqTq0/aXk/fnXeqZ0O7zkHAPr2vxr/dXik89TbWI1g6LcmB/zXl+2/MqFUbGNxfl51Pu3Pr0YoxLtsRReoxZxv45iqfK+TnrIhSsfwKoWabCWkmBycGwhQhm03rgKZQ==
bTUOEHanzeBncoPs4oIe+TmAGSVM8zMawAMpQasH6Z1Xt603BgUQm5r0rvn1uFwvJnduYh7e19QLGo7eYEkj6bWrk1dtOUPh7Esv1KTehWmsJArdHwmsPWC9L41Wjua9ePpG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3YqLrII5NcPzMZ+nXK3MqQ==
; bad config
_authToken=MYTOKEN
; good config
@myorg:registry=https://somewhere-else.com/myorg
@another:registry=https://somewhere-else.com/another
//registry.npmjs.org/:_authToken=MYTOKEN
; would apply to both @myorg and @another
; //somewhere-else.com/:_authToken=MYTOKEN
; would apply only to @myorg
//somewhere-else.com/myorg/:_authToken=MYTOKEN1
; would apply only to @another
//somewhere-else.com/another/:_authToken=MYTOKEN2