@@ -16,6 +16,7 @@ npm install [<@scope>/]<name>
16
16
npm install [< @scope> /]< name> @< tag>
17
17
npm install [< @scope> /]< name> @< version>
18
18
npm install [< @scope> /]< name> @< version range>
19
+ npm install < alias> @npm:< name>
19
20
npm install < git-host> :< git-user> /< repo-name>
20
21
npm install < git repo url>
21
22
npm install < tarball file>
@@ -113,6 +114,24 @@ after packing it up into a tarball (b).
113
114
114
115
npm install sax
115
116
117
+ * ` npm install <alias>@npm:<name> ` :
118
+
119
+ Install a package under a custom alias. Allows multiple versions of
120
+ a same-name package side-by-side, more convenient import names for
121
+ packages with otherwise long ones and using git forks replacements
122
+ or forked npm packages as replacements. Aliasing works only on your
123
+ project and does not rename packages in transitive dependencies.
124
+ Aliases should follow the naming conventions stated in
125
+ [ ` validate-npm-package-name ` ] ( https://www.npmjs.com/package/validate-npm-package-name#naming-rules ) .
126
+
127
+ Examples:
128
+
129
+ npm install my-react@npm:react
130
+ npm install jquery2@npm:jquery@2
131
+ npm install jquery3@npm:jquery@3
132
+ npm install npa@npm:npm-package-arg
133
+
134
+
116
135
` npm install ` saves any specified packages into ` dependencies ` by default.
117
136
Additionally, you can control where and how they get saved with some
118
137
additional flags:
0 commit comments