有时候,我们可能需要对 npm 在本地的配置进行查看和校验。 可以使用命令 npm config list 来显示配置信息。 针对我们当前运行的项目,我们输出的配置信息为: PS D:\WorkDir\Repository\iSharkfly-Docs\Docs\docs-isharkfly-com> npm config list ; "builtin" config from C:\Users\yhu\AppData\Roaming\npm\node_modules\npm\npmrc prefix = "C:\\Users\\yhu\\AppData\\Roaming\\npm" ; "user" config from C:\Users\yhu\.npmrc //repo.isharkfly.com/repository/npm-public/:_authToken = (protected) //repo.isharkfly.com/repository/npm/:_authToken = (protected) registry = "https://repo.isharkfly.com/repository/npm-public/" repo.isharkfly.com/repository/npm/:_authToken = "NpmToken.***" ; node bin location = C:\Program Files\nodejs\node.exe ; node version = v18.20.2 ; npm local prefix = D:\WorkDir\Repository\iSharkfly-Docs\Docs\docs-isharkfly-com ; npm version = 10.8.1 ; cwd = D:\WorkDir\Repository\iSharkfly-Docs\Docs\docs-isharkfly-com ; HOME = C:\Users\yhu ; Run `npm config ls -l` to show all defaults. PS D:\WorkDir\Repository\iSharkfly-Docs\Docs\docs-isharkfly-com> 从上面的配置信息,我们可以了解到程序安装时候使用的路径等。 以及使用的是那个库。 https://www.isharkfly.com/t/npm/17173