一、可执行文件位置
which node
/usr/local/bin/node
npm
Specify configs in the ini-formatted file:
/Users/zzf073/.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config
npm@6.4.1 /usr/local/lib/node_modules/npm
二、nmp配置信息
npm config list
; cli configs
metrics-registry = "https://registry.npmjs.org/"
scope = ""
user-agent = "npm/6.4.1 node/v10.15.3 darwin x64"
; userconfig /Users/zzf073/.npmrc
prefix = "/Users/zzf073/nmp"
; node bin location = /usr/local/bin/node
; cwd = /Users/zzf073
; HOME = /Users/zzf073
; "npm config ls -l" to show all defaults.
三、文件放置位置
npm list -g
/Users/zzf073/nmp/lib
├─┬ create-react-app@3.3.0
npm config get prefix
/Users/zzf073/nmp
npm config set prefix
npm ls --parseable
/Users/zzf073/nmp/lib
/Users/zzf073/nmp/lib/node_modules/create-react-app
/Users/zzf073/nmp/lib/node_modules/create-react-app/node_modules/chalk
/Users/zzf073/nmp/lib/node_modules/create-react-app/node_modules/commander
/Users/zzf073/nmp/lib/node_modules/create-react-app/node_modules/cross-spawn
/Users/zzf073/nmp/lib/node_modules/create-react-app/node_modules/envinfo
四、疑问
node_modules有几个?
cli可用的
/usr/local/lib/node_modules
不知道干啥用的
/Users/zzf073/node_modules/
设置prefix后安装的
/Users/zzf073/nmp/lib/node_modules