I study NodeJS. I want to make it so that each project has its own env and at the same time - does not keep the system-wide dependencies.

How is this done correctly (using python-nodeenv, chroot, docker, or just a directory with node_modules + package.json)?

Will JebBrains products (debugging, inspection, autocomplex) work with the project with similar use?

  • Conventionally, "node_modules + package.json", if you ignore the globally installed node. - Vladimir Gamalyan
  • Here you want to avoid the global environment. So that I could take an example for the old Node (or LTS) and implement something of my own, and then open another example where the latest version of Node is and use what is written there. - Tihon
  • node_modules + package.js is a dependency project. And nothing will prevent installing the node itself directly into the project, although I personally tend to indicate the version in package.json + nvm, but this is when I do not write server applications for which the docker is used. - user220409

1 answer 1

The easiest way was to install nodejs globally and use package.json. And I call various software that comes from npm like this:

PATH=$(npm bin):$PATH $cli_util