zoukankan      html  css  js  c++  java
  • npm-folders

    https://docs.npmjs.com/configuring-npm/folders.html

    npm puts various things on your computer. That’s its job.

    This document will tell you what it puts where.

    tl;dr§

    • Local install (default): puts stuff in ./node_modules of the current package root.
    • Global install (with -g): puts stuff in /usr/local or wherever node is installed.
    • Install it locally if you’re going to require() it.
    • Install it globally if you’re going to run it on the command line.
    • If you need both, then install it in both places, or use npm link.

    prefix Configuration§

    The prefix config defaults to the location where node is installed. On most systems, this is /usr/local. On Windows, it’s %AppData% pm. On Unix systems, it’s one level up, since node is typically installed at {prefix}/bin/node rather than {prefix}/node.exe.

    When the global flag is set, npm installs things into this prefix. When it is not set, it uses the root of the current package, or the current working directory if not in a package already.

    Node Modules§

    Packages are dropped into the node_modules folder under the prefix. When installing locally, this means that you can require("packagename") to load its main module, or require("packagename/lib/path/to/sub/module") to load other modules.

    Global installs on Unix systems go to {prefix}/lib/node_modules. Global installs on Windows go to {prefix}/node_modules (that is, no lib folder.)

    Scoped packages are installed the same way, except they are grouped together in a sub-folder of the relevant node_modules folder with the name of that scope prefix by the @ symbol, e.g. npm install @myorg/package would place the package in {prefix}/node_modules/@myorg/package. See scope for more details.

    If you wish to require() a package, then install it locally.

  • 相关阅读:
    [Sql Server][原创]
    SQL Server T-SQL高级查询
    SQL 网文链接
    Epicor系统二次开发
    lambda表达式的变量作用域
    写一个正则表达式匹配手机号
    函数装饰器在类方法中的使用方法
    关于Django的session的使用 (装饰器版)
    Django ORM相关操作(2)
    Django ORM相关操作(1)
  • 原文地址:https://www.cnblogs.com/chucklu/p/12917669.html
Copyright © 2011-2022 走看看