npm 全局安装目录

  • Post author:
  • Post category:其他




npm 全局安装目录

使用

npm i xxx -g

的都会安装到该目录下;还有使用

npm link

也会有关联的目录在改目录下;



1.使用命令查看 npm 配置信息


npm config ls



# mac会有如下显示:

; "global" config from /usr/local/etc/npmrc



disturl = "https://npm.taobao.org/dist"

; registry = "https://registry.npm.taobao.org/" ; overridden by user



; "user" config from /Users/wuzhiqiang/.npmrc



//localhost:8081/repository/npm-group/:_authToken = (protected)

//localhost:8081/repository/npm-local/:_authToken = (protected)

registry = "https://registry.npmjs.org/"



; node bin location = /usr/local/bin/node

; cwd = /Users/wuzhiqiang/Desktop/文档

; HOME = /Users/wuzhiqiang

; Run `npm config ls -l` to show all defaults.



2.默认路径



1. windows 系统下

默认路径:

C:\Users\zhao\AppData\Roaming\npm



2. mac 系统下

默认路径:

/usr/local/lib/node_modules/



版权声明:本文为zzttwzq原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。