-
Notifications
You must be signed in to change notification settings - Fork 1
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
- Create a
node_modules
-folder in the project-root - 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
- Run the regular installation as described here
- Delete all the symlinks created in step 2
- Move all remaining files and folders from the project-node_modules folder to the projects parent-folder
- 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.