npm安装包在哪里? [英] Where does npm install packages?
问题描述
有人能告诉我在哪里可以找到我使用 npm
安装的Node.js模块吗?
Can someone tell me where can I find the Node.js modules, which I installed using npm
?
推荐答案
全局库
您可以运行 npm list -g
查看全局库的安装位置。
Global libraries
You can run npm list -g
to see where global libraries are installed.
在Unix系统上,它们通常放在 / usr / local / lib / node中全局安装时
或 / usr / local / lib / node_modules
。如果将 NODE_PATH
环境变量设置为此路径,则可以按节点找到模块。
On Unix systems they are normally placed in /usr/local/lib/node
or /usr/local/lib/node_modules
when installed globally. If you set the NODE_PATH
environment variable to this path, the modules can be found by node.
Windows XP - %USERPROFILE%\ AppData \ npm \ node_modules
Windows 7,8和10 - %USERPROFILE%\ AppData\Roaming\\\
pm\\\
ode_modules
Windows XP - %USERPROFILE%\AppData\npm\node_modules
Windows 7, 8 and 10 - %USERPROFILE%\AppData\Roaming\npm\node_modules
非全局库安装在您当前所在文件夹中的 node_modules
子文件夹中。
Non-global libraries are installed the node_modules
sub folder in the folder you are currently in.
您可以运行 npm list
查看当前位置的已安装非全局库。
You can run npm list
to see the installed non-global libraries for your current location.
这篇关于npm安装包在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!