Where does npm install packages?

后端 未结 23 1339
梦毁少年i
梦毁少年i 2020-11-22 06:03

Can someone tell me where can I find the Node.js modules, which I installed using npm?

23条回答
  •  既然无缘
    2020-11-22 06:23

    The command npm root will tell you the effective installation directory of your npm packages.

    If your current working directory is a node package or a sub-directory of a node package, npm root will tell you the local installation directory. npm root -g will show the global installation root regardless of current working directory.

    Example:

    $ npm root -g
    /usr/local/lib/node_modules
    

    See the documentation.

提交回复
热议问题