|
| 1 | +#Use Cases |
| 2 | + |
| 3 | +If you created or are maintaining a version manager, please help identify edge/use cases you've encountered. |
| 4 | + |
| 5 | +## Redeployment |
| 6 | +(by @coreybutler) |
| 7 | + |
| 8 | +In some environments (government, defense, some corporations), the developer environment is locked down. |
| 9 | +To facilitate this, many organizations utilize Active Directory as a source of supervised software installations. |
| 10 | + |
| 11 | +- Difficult/impossible to track usage. |
| 12 | +- Silent installers are necessary (must be modifiable by the organization) |
| 13 | +- Alternative feed of version availability is necessary to prevent confusion. |
| 14 | + |
| 15 | +## Offline Access Use Case |
| 16 | +(by @coreybutler) |
| 17 | + |
| 18 | +A state education agency managed technical infrastructure for all school districts, many of which are in rural/remote areas. |
| 19 | +Some of them have no internet access, and many have very strained bandwidth, yet they want/need to use newer versions of Node. |
| 20 | +They need a local mirror of Node executables, as well as npm mirrors (optional, but mostly impractical to not have this). |
| 21 | + |
| 22 | +- Difficult/impossible to track usage. |
| 23 | +- Completely different update method (manually copy resources to a mirror from a USB drive or other physically transportable media) |
| 24 | +- A feed of available versions needs to be accessible in a LAN. |
| 25 | + |
| 26 | +## Roaming Profiles & npm Bloat |
| 27 | +(by @coreybutler) |
| 28 | + |
| 29 | +A company uses roaming profiles, expecting their node environments to roam with them. Global `node_modules` are a part of this. |
| 30 | +Due to the number of dependencies, the `node_modules` directory was enormous, and “almost redundant”, meaning many versions of |
| 31 | +the same module with minor variations. This caused the user a 30 minute bootup time while waiting for ALL node environments to copy |
| 32 | +from the server to a new desktop. |
| 33 | + |
| 34 | +- Horrible user experience |
| 35 | + |
| 36 | +## Architecture Awareness |
| 37 | +(by @coreybutler) |
| 38 | + |
| 39 | +Some native dependencies require different versions of libraries depending on the architecture (32 vs 64 bit). Users need a |
| 40 | +`node_modules` directory specific to a version of node and it’s architecture. |
| 41 | + |
| 42 | +- 2 global node_modules directories per Node.js version if supporting both 32/64-bit (double the already large footprint). |
| 43 | + |
| 44 | +## Yarn: Missing Information |
| 45 | +(by @coreybutler) |
| 46 | + |
| 47 | +When yarn was released, it was looking for a specific Windows registry key to determine whether Node was installed on the |
| 48 | +system. Different version managers approach the registry differently. Since there is no spec answering “how to determine |
| 49 | +if Node is installed?”, version managers have provided alternative solutions. |
| 50 | + |
| 51 | +- Lacking an “authoritative” spec stifles integration. |
| 52 | + |
| 53 | +## Confused Community |
| 54 | +(by @coreybutler) |
| 55 | + |
| 56 | +Many people do not understand the differences between version managers. The yarn team [didn’t realize](https://github.com/yarnpkg/yarn/issues/626#issuecomment-252993114) |
| 57 | +people were using certain version managers at all. At NINA'16, @williamkapke mentioned that he just assumed nvm and n were the same thing. |
| 58 | +Many people confuse nvm and nvm-windows as being the same functional thing for different operating systems. |
| 59 | + |
| 60 | +- Insufficient and/or unclear public messaging. |
| 61 | + |
| 62 | +_NOTE:_ @marcelklehr put together a concise [list of usage types](https://github.com/nodejs/version-management/issues/4#issuecomment-258567834) that would |
| 63 | +make a good starting point to educate the community about the options (or at least make them aware they have a choice). |
| 64 | + |
| 65 | +## Permission Problems (Shims) |
| 66 | +(by @coreybutler) |
| 67 | + |
| 68 | +Using a shim changes the execution context of the node process (I troubleshoot this all the time in [node-windows](https://github.com/coreybutler/node-windows)). |
| 69 | +A shim may run under a specific user (root, elevated admin), but it treats node as a child process, which (unless specified) runs |
| 70 | +under the default user context. In other words, it masks the user context. |
| 71 | + |
| 72 | +- Symlinks execute node “directly”, guaranteeing the user context. |
| 73 | +- Shims can potentially change the value of `__dirname, process.cwd()`, and user. |
| 74 | +- Symlinks on Windows can be hard or soft. This choice effects whether it will work across multiple hard drives on a computer. |
0 commit comments