Node.js/npm/指令

来自康健生活
Kangkk​(留言 | 贡献)2025年7月19日 (六) 04:11的版本 (创建页面,内容为“== 安装路径 == === 路径 === {{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…”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

安装路径

路径

[jian@kang /home/kwy]$
npm root -g
/usr/local/lib/node_modules

环境

[jian@kang /home/kwy]$
npm config ls
; 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.

prefix

查询

jian@kang:/mnt/c/kangkk
npm config get prefix
/home/kangjian/.nvm/versions/node/v14.16.1

设置

 
npm config set prefix *