3 ms·
Node developer here - it’s crazy that the canonical solution embraced by Python developers involves full-on virtual environments.
by benced 4y ago
Node developer here - it’s crazy that the canonical solution embraced by Python developers involves full-on virtual environments.
- CogitoCogito 4y agoIs it that surprising? Wouldn't you consider node_modules/ basically a virtual environment as well? Python didn't go the node route from the beginning so virtual environments make a lot of sense to fix the issues. Node presumably drew lessons from python and other sources and went with the full recursive design from the beginning.
- rcarmo 4y agoYep. I set up my Node projects in the equivalent of a venv (largely because I’ve found a lot more dependency hell in Node than in Python, especially around nested dependencies that would clobber things in other projects)
- leontrolski 4y agoI wrote a short guide for confused node developers at work a while ago https://leontrolski.github.io/virtualenvs-for-node-devs.html https://leontrolski.github.io/virtualenvs-for-node-devs.html
- viraptor 4y agoThat the same as npm (node), bundler (ruby), and many other solutions do. Some details differ, but the concept is the same.
- samwillis 4y agoBut venvs are even more powerful than npm node_modules, it gives you complete control of the path. No need for “npm run” stuff. Take a look at https://pypi.org/project/nodejs-bin/ https://pypi.org/project/nodejs-bin/. It lets you install a specific project version of Node in a Python venv.