Common CI instructions

1.View all NPM commands entered in the console'npm'Or input'npm help'
    'access'.'adduser'.'audit'.'bin'.'bugs'.'c'.'cache'.'ci'.'cit'.'clean-install'.'clean-install-test'.'completion'.'config'.'create'.'ddp'.'dedupe'.'deprecate'.'dist-tag'.'docs'.'doctor'.'edit'.'explore'.'fund'.'get'.'help'.'help-search'.'hook'.'i'.'init'.'install'.'install-ci-test'.'install-test'.'it'.'link'.'list'.'ln'.'login'.'logout'.' ls'.'org'.'outdated'.'owner'.'pack'.'ping'.'prefix'.'profile'.'prune'.'publish'.'rb'.'rebuild'.'repo'.'restart'.'root'.'run'.'run-script'.'s'.'se'.'search'.'set'.'shrinkwrap'.'star'.'stars'.'start'.'stop'.'t'.'team'.'test'.'token'.'tst'.'un'.'uninstall'.'unpublish'.'unstar'.'up'.'update'.'v'.'version'.'view'.'whoami'
2.Want to see the simple use of command --'npm -l'
Copy the code
View the version of NPM

npm -v

View the configuration of NPM

npm config list -l

npm install

Summary of several ways to install packages, before summarizing the first know1.'@scope'The NPM package we install normally has a name to help us install the package we need. With more and more packages, the probability of the name duplication will become high'@scope'Each NPM user/organization has its own scope for this identifier, and only you can add packages within your scope. This means you don't have to worry about someone using your package name before you do. As such, it is also a good way to signal to your organization that an official package is available. For example'npm i @vue/cli-service'

2.'@<tag>'In most cases, the package tag version installed by default in most cases will be'latest', which is the default'latest'If you specify this tag during installation, the latest version of the tag will be installed. Generally, there are three common tags2.1.latest: this is the latest version of NPM install2.2Beta: indicates the test version, which is generally used for internal testing. You need to specify the version number install, for example3.1. 0-beta. 0
 2.3.next: prior version, NPM install foo@next, for example3.02.-alpha. 0View the tag version of a package'npm dist-tag ls [ < pkg > ] 'The following figure shows webpack as an example3.'@<version>'Install the specified version of the package. This will fail if the version has not been published to the registry, although the version can specify a range'@<version range>'For example, most version ranges must be in quotes'NPM install pack @ "> = 0.1.0 from < 0.2.0"'To view the version of a package'npm view package versions'This will look up all versions of the package,'npm view package version'This checks the current version installed by default, as shown in figure vue, the current writing node is still the latest version'2.x'

4.'npm'Not only can it be installed on'npm'Packages published on repositories can also be installed for example'github'

5.'npm'You can also install it via a Git installation address6.'<alias>@npm'To the package in'node_modules'For details, refer to the following case summary:'npm'It is possible to install a large node package in another repositoryCopy the code
  • Look at the tag

  • Vue View the version

Install install instructions
npm install (with no args, in package dir)
npm install [<@scope>/]<name>
npm install [<@scope>/]<name>@<tag>
npm install [<@scope>/]<name>@<version>
npm install [<@scope>/]<name>@<version range>
npm install <alias>@npm:<name>
npm install <git-host>:<git-user>/<repo-name>
npm install <git repo url>
npm install <tarball file>
npm install <tarball url>
npm install <folder>

aliases: npm i, npm add
common options: [-P|--save-prod|-D|--save-dev|-O|--save-optional] [-E|--save-exact] [-B|--save-bundle] [--no-save] [--dry-run]
Copy the code
Install — Current and global installations
1.directly'npm install', NPM install will install all dependencies under package.json by default2.This can be used if you want to install globally'-g or --global append to command '
Copy the code
npm install package
1.For example'npm install axios'You can install it'axios'And as I said above, the variant is equal to'npm install axios@latest'
Copy the code
[<@scope>/]@< tag> — Specifies the tag installation
1.Install the tag package specified under an organization, as shown here'vue/cli'For example,'npm install @vue/cli@next'
Copy the code
npm install [<@scope>/]< name>@< version range>
1.Specify the version of the package to install'npm install [email protected]'Or install a specified scope'NPM install sax@">=0.1.0 <0.2.0"'
Copy the code
npm install @npm:< name>
1.Install a package under a custom alias to specify an alias'npm install mmzz@npm:jquery'
Copy the code

npm install < git remote url>
1.Install directly with username and repository name -- NPM install easterCat/ Kiana-js2.NPM install github:easterCat/kiana-js3.NPM install git+ HTTPS://github.com/easterCat/kiana-js.git

4.NPM install git+ SSH://github.com/easterCat/kiana-js.git

5.NPM install axios/axios is equivalent to NPM install github:axios/axios, which means that if the @ sign is omitted, NPM will try to install from Github in either caseCopy the code
  • Tag in the Packjson version

other
1.NPM install <tarball file> Example: NPM install. /package. TGZ2.<tarball URL > Example: NPM install HTTPS:/ / github.com/indexzero/forever/tarball/v0.5.6
 
3.NPM install < Folder > NPM install < Folder >Copy the code

reference

npm-install

npm-version

npm-dist-tag

NPM version and tag