- 1 year ago
How to create an NPM package installing directly from a private TFS Repo
To create an NPM package that installs directly from a private TFS (Team Foundation Server) repository, you can follow these steps:
Create a
.npmrc
file in the root directory of your project. This file will contain the registry information for your TFS repository. Open the.npmrc
file in a text editor and add the following line:arduinoregistry=https://your-tfs-repo-url/npm
Replace
your-tfs-repo-url
with the actual URL of your TFS repository.Run the
npm login
command in your terminal and provide the authentication details for your TFS repository. This will authenticate you with your TFS account and allow you to access the private packages in the repository.In the
package.json
file of your project, specify the dependencies that you want to install from the TFS repository. For example:json{
"dependencies": {
"my-private-package": "1.0.0"
}
}
Replace
my-private-package
with the name of the package in your TFS repository, and specify the desired version.Run
npm install
to install the dependencies. NPM will use the registry specified in the.npmrc
file to fetch the package from your TFS repository.
Make sure that your TFS repository is properly configured to serve NPM packages and that you have the necessary permissions to access the private packages.