简体   繁体   中英

How to ensure dependency isolation in node project?

I 'm reading the 12-factor-app manifesto and stumbled upon the concept of dependency isolation here . I'm familiar with the concept from working in Python projects using conda . But how can I achieve the same kind of isolation in a nodeJS application?

I had the case in the past where I had eslint installed globally but not defined in package.json in the project. The CI/CD failed later because of a missing dependancies. So I know how much important this can be.

Of course I can always run my apps inside isolated docker containers, but I feel like this is an overkill for local development specially for small projects.

Is there any way to ensure dependancy isolation in nodejs projects?

I believe yarn.lock (for yarn) serves the purpose. All deps are written down there and you can store in source control

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