文件夹

npm 使用的文件夹结构

描述

npm 在您的计算机上放置各种东西。这就是它的工作。

这份文件会告诉你它把什么放在哪里。

tl;dr

  • 本地安装(默认):将东西放在当前包根目录的 ./node_modules 中。
  • 全局安装(使用 -g):将内容放在 /usr/local 或安装 node 的任何位置。
  • 如果您要 require() 它,请在本地安装它。
  • 如果要在命令行上运行它,请全局安装它。
  • 如果两者都需要,那么在两个地方都安装,或者使用npm link

前缀配置

prefix 配置 默认是安装 node 的位置。在大多数系统上,这是 /usr/local。在 Windows 上,它是 %AppData%\npm。在 Unix 系统上,它是上一级的,因为 node 通常安装在 {prefix}/bin/node 而不是 {prefix}/node.exe

8ptXGTHIx4jHlgD45/QPNSfIHKZw0IMXVKoj/Pc/9PLyZuT83dNFnhf/LFyxhiLTM93acOTp8AmEk7PyOPqhtCfI3xzPYIiZtG4sPww4knpgaeYMr3z7nho5aFciU9xvs4jlBeCo3CKffNFYk3NZdwyX7KkQi3m/PHf3H3oHdlPDSezPAISacmL3JjeER7s0yUmzvVKAAklaln5Keurb6bYCghMy8wzbkeiBCL0Y2AjIzrWYOpM+fN6FozexOLJH

Node 模块

Z2B5Pr891JWXjckHqR3npLewzpeanuIjOFCCNXIZiULtiBAaL2B1zupHcndulIucGdAUzSDfu3E6xzobZlnSGvNvq6JXcDeXtvEZTmgFIkrKm0O6Urf3N1L6eO+glJpemtpSZBXUv5u562ZIyW0ieuBSEYUQjbH6hXu6OzOvc+FvS6tfODw6fcG3wF6O1uBUHmYN5ibBRzzQ55osVhAFz6qaPLQEy8Buej3DaP0kDnzQZaEbWJ2xrbpPAhm+uItte4rgr7nYw+cjXcf+4RkwhYxHYBKfiVioSdlJpCCZs6f7gdrDuT/lic+jH8B4Ae1AvCizGhgsZg1vXFSuTyZLxXjp2YB26EGz/+3S9tAMEYs=

MqXNnE7Sd1kvgebny6CgQcjcx+GwpQJUqMLbYOE5THVZ+FB9qWZjgEyvyj06PwsZClEiTGfEbGkb2BsZHRnsymYPehkm7FypVwnfGI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9D86lCP4JUubLPfPY=

foo
+-- node_modules
    +-- blerg (1.2.5) <---[A]
    +-- bar (1.2.3) <---[B]
    |   +-- node_modules
    |       +-- baz (2.0.2) <---[C]
    +-- asdf (2.3.4)
    +-- baz (1.2.3) <---[D]
    +-- quux (3.2.0) <---[E]

B1i5lH88stCQO2tNI+aM0l4f2gIcZVxGQZ5pwkrpidTFcSn7QE8BoCFLXlwSwXvyWy4b+W16QoYQR5kt9zbHXi9Y/OChu3zUapFm+2Rk2HQgJ15dDxqUzoYmtL/95VlQDoEJmQGC/u2IcStjg01C2bXmSHTdplN47t2YaorxAeDdtO1VMdSht5wA3z/MUDgcYnvsq6xMf7Zv+If0BVBfkA==

tsOJX8SXHL1TfaGCcnLxpIlGHrQCaeliBQ86teA9OKgg58EFE8BT5plqemwjUtXR4x71BupcE9A0Rz6JILPzoDF28vzgrPQ8/tUc32uo5NMcfROTBCnqfQSIF6Vd2tQYsc35D/QhBNAOxhnCm4T2Hcd+AxWtXpoyAU4JD/JUudV2PTv8W1qvt6Q2O12a/VSF862BlihzjpkI510jw+Ge1n+SJSR8pTGYmWczu0qH8eQXThsaZKC/omA6hlV3RZZT6kr3okB76ZjjpJndgzywmJS8D+SKxmWK5zI+U1l78hPuVDZb1n6rZ8MbnLGTpFBT

c8HcFhCMpi9LT4cZBsak5L81qwUAK9RWUqv263E4XgokkqyKW1ZRZUoaTMuYapNcCkWA46NFkYlVOserHAmbUZFWQd6WsLAxiAS0p/5Ce1N4jX4dwzrmnakFkx8F7mk5RKjZvuU120PzBDlhwd61JY/AF49OODAVo2JxWCNttGJWXqhT9EGHTSikihYZrUL/2PK1KftWO0+QEi8X420Tqw1V4SVVluBi72Sdl5Dy0ejWflUJ3N5or3VY3IydwXJktaP7cjAc9w9765YgZllQrsO9QLiGnSRkLxFZSU176UUabnoE+s/nlu98BMbW2B4uqBrtrh0lZVdtOinR3XSKSzMZU6fIM0ukShi0CODvjzcPeugb8m4OPPYh7mppOc9j2hFD1xZ7N2pL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