NPM Install suffix

Source: Internet
Author: User
NPM Global installation and local installation
npm install express          # 本地安装npm install express -g   # 全局安装
Local Installation
  1. Place the installation package under./node_modules (the directory where the NPM command is running), and if there is no Node_modules directory, the Node_modules directory is generated under the directory where the NPM command is currently executing.
  2. Locally installed packages can be introduced via require ().

    Global Installation
  3. Place the installation package under/usr/local or your node's installation directory.
  4. Can be used directly on the command line.

If you want to have both features, you'll need to install it in two places or use NPM link.

The following are the meanings of the install suffix

npm install moduleName # 安装模块到项目目录下(不会将模块依赖写入devDependencies或dependencies 节点。)--save  将模块安装到项目目录下,并在package文件的dependencies节点写入依赖。-P, --save-prod:包会出现在你的dependencies。这是默认的,除非-D或-O存在。        -D, --save-dev:包会出现在你的devDependencies。-O, --save-optional:包会出现在你的optionalDependencies。--no-save:防止保存到dependencies。

NPM Install suffix

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.