Node.js/npm:修订间差异

来自康健生活
Kangkk​(留言 | 贡献)
Kangkk​(留言 | 贡献)
第65行: 第65行:


== 指令 ==
== 指令 ==
== 安装路径 ==
=== 路径 ===
{{shc_out|<syntaxhighlight lang="bash">
npm root -g</syntaxhighlight>|<syntaxhighlight lang="text">
/usr/local/lib/node_modules</syntaxhighlight>|$}}
=== 环境 ===
{{shc_out|<syntaxhighlight lang="bash">
npm config ls</syntaxhighlight>|<syntaxhighlight lang="text">
; cli configs
metrics-registry = "https://registry.npm.taobao.org/"
scope = ""
user-agent = "npm/6.14.5 node/v12.18.1 linux x64"
; userconfig /home/kangjian/.npmrc
home = "https://npm.taobao.org"
registry = "https://registry.npm.taobao.org/"
; node bin location = /usr/local/bin/node
; cwd = /home/kangjian/tongdunol
; HOME = /home/kangjian
; "npm config ls -l" to show all defaults.
</syntaxhighlight>|$}}
=== prefix ===
查询
{{Shc_out|<syntaxhighlight lang="bash">
npm config get prefix
</syntaxhighlight>|<syntaxhighlight lang="bash">
/home/kangjian/.nvm/versions/node/v14.16.1
</syntaxhighlight>|jian@kang:/mnt/c/kangkk}}
设置
{{shc|<syntaxhighlight lang="bash">
npm config set prefix *</syntaxhighlight>|$}}


== 全局 ==
== 全局 ==