Skip to content

Process for installation as dependency

Heiko Mathes edited this page Dec 20, 2016 · 1 revision

These are the steps minstall takes, when it detects, that the module is installed as dependency of something else.

This only happens, when there is no node_modules-folder in the project folder, but the parent-folder of the project-folder is called node_modules. This on the other hand, only happens on npm 3, when the package that uses minstall is installed via npm install

  1. Create a node_modules-folder in the project-root
  2. Symlink all folders from the parent-folder to the newly created project-node_modules, except for the project-folder itself. In this step, the names of the folders that get symlinked get cached
  3. Run the regular installation as described here
  4. Delete all the symlinks created in step 2
  5. Move all remaining files and folders from the project-node_modules folder to the projects parent-folder
  6. Delete the projects-node_modules folder.

This essentially provides a complete node_modules-folder pre-installation, and applies the result of the changes to it during the installation to the parent-folder.

Clone this wiki locally