Reputation: 3671
I have a feed configured in Azure DevOps, with an upstream feed of https://registry.npmjs.org.
When I run yarn
from my terminal, all of the packages in my package.json and their dependencies are correctly downloaded to my machine, but only a subset are added to my feed (59 packages listed in the feed vs. 1029 in my node_modules
folder). There are 17 packages explicitly listed in my package.json
.
I need to have all of the packages/dependencies stored in the DevOps feed so that we can restrict allowable packages and versions. We want to prevent regular developers from adding new packages or changing package versions on a project - letting them just pick from the "approved" packages/versions (which we do by requiring them to use a different feed which is configured with only our "restricted" feed as its upstream source). If there's another way to do this, that's fine.
Upvotes: 0
Views: 702
Reputation: 8298
Once you consume a package from an upstream source once, a copy of it is always saved in your feed.
This may be caused by the cache, If the package is already cached locally. It will not download again and save the package in your feed.
Please run the command npm cache verify
, you can see the package path along with other details. Clean the package cache and try it again, it should save all packages downloaded from the upstream feed.
In addition, please also try to run the project via hosted agent. With Microsoft-hosted agents, each time you run a pipeline, you get a fresh virtual machine.
I hope it can help you.
Upvotes: 1