Created
July 29, 2021 22:47
-
-
Save isaacs/e9b878aa04fb988558cdc37c74d6b063 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ tree | |
. | |
├── .npmrc | |
├── foo | |
│ ├── .npmrc | |
│ ├── a | |
│ │ └── b | |
│ │ └── c | |
│ │ └── d | |
│ │ └── e | |
│ └── package.json | |
└── package.json | |
$ cat .npmrc | |
foo = bar | |
$ cat foo/.npmrc | |
workspace-root=.. | |
$ cat package.json | |
{ | |
"name": "root", | |
"version": "1.2.3", | |
"workspaces": [ | |
"foo" | |
] | |
} | |
$ npm config ls | |
{ | |
'workspace-root': null, | |
workspace: [], | |
localPrefix: '/Users/isaacs/dev/npm/cli/fixtures/wsroot' | |
} | |
; "project" config from /Users/isaacs/dev/npm/cli/fixtures/wsroot/.npmrc | |
foo = "bar" | |
; "env" config from environment | |
userconfig = "/Users/isaacs/dev/npm/cli/fixtures/.npmrc" | |
; node bin location = /usr/local/bin/node | |
; cwd = /Users/isaacs/dev/npm/cli/fixtures/wsroot | |
; HOME = /Users/isaacs | |
; Run `npm config ls -l` to show all defaults. | |
$ cd foo | |
/Users/isaacs/dev/npm/cli/fixtures/wsroot/foo | |
$ npm config ls | |
{ | |
'workspace-root': '/Users/isaacs/dev/npm/cli/fixtures/wsroot', | |
workspace: [ '/Users/isaacs/dev/npm/cli/fixtures/wsroot/foo' ], | |
localPrefix: '/Users/isaacs/dev/npm/cli/fixtures/wsroot' | |
} | |
npm WARN config This command does not support workspaces. | |
; "project" config from /Users/isaacs/dev/npm/cli/fixtures/wsroot/.npmrc | |
foo = "bar" | |
; "workspace" config from /Users/isaacs/dev/npm/cli/fixtures/wsroot/foo/.npmrc | |
workspace = ["/Users/isaacs/dev/npm/cli/fixtures/wsroot/foo"] | |
workspace-root = "/Users/isaacs/dev/npm/cli/fixtures/wsroot" | |
; "env" config from environment | |
userconfig = "/Users/isaacs/dev/npm/cli/fixtures/.npmrc" | |
; node bin location = /usr/local/bin/node | |
; cwd = /Users/isaacs/dev/npm/cli/fixtures/wsroot/foo | |
; HOME = /Users/isaacs | |
; Run `npm config ls -l` to show all defaults. | |
$ cd a/b/c/d/e | |
/Users/isaacs/dev/npm/cli/fixtures/wsroot/foo/a/b/c/d/e | |
$ npm config ls | |
{ | |
'workspace-root': '/Users/isaacs/dev/npm/cli/fixtures/wsroot', | |
workspace: [ '/Users/isaacs/dev/npm/cli/fixtures/wsroot/foo' ], | |
localPrefix: '/Users/isaacs/dev/npm/cli/fixtures/wsroot' | |
} | |
npm WARN config This command does not support workspaces. | |
; "project" config from /Users/isaacs/dev/npm/cli/fixtures/wsroot/.npmrc | |
foo = "bar" | |
; "workspace" config from /Users/isaacs/dev/npm/cli/fixtures/wsroot/foo/.npmrc | |
workspace = ["/Users/isaacs/dev/npm/cli/fixtures/wsroot/foo"] | |
workspace-root = "/Users/isaacs/dev/npm/cli/fixtures/wsroot" | |
; "env" config from environment | |
userconfig = "/Users/isaacs/dev/npm/cli/fixtures/.npmrc" | |
; node bin location = /usr/local/bin/node | |
; cwd = /Users/isaacs/dev/npm/cli/fixtures/wsroot/foo/a/b/c/d/e | |
; HOME = /Users/isaacs | |
; Run `npm config ls -l` to show all defaults. | |
$ npm config ls -w bar | |
{ | |
'workspace-root': '/Users/isaacs/dev/npm/cli/fixtures/wsroot', | |
workspace: [ 'bar' ], | |
localPrefix: '/Users/isaacs/dev/npm/cli/fixtures/wsroot' | |
} | |
npm WARN config This command does not support workspaces. | |
; "project" config from /Users/isaacs/dev/npm/cli/fixtures/wsroot/.npmrc | |
foo = "bar" | |
; "workspace" config from /Users/isaacs/dev/npm/cli/fixtures/wsroot/foo/.npmrc | |
; workspace = ["/Users/isaacs/dev/npm/cli/fixtures/wsroot/foo"] ; overridden by cli | |
workspace-root = "/Users/isaacs/dev/npm/cli/fixtures/wsroot" | |
; "env" config from environment | |
userconfig = "/Users/isaacs/dev/npm/cli/fixtures/.npmrc" | |
; "cli" config from command line options | |
workspace = ["bar"] | |
; node bin location = /usr/local/bin/node | |
; cwd = /Users/isaacs/dev/npm/cli/fixtures/wsroot/foo/a/b/c/d/e | |
; HOME = /Users/isaacs | |
; Run `npm config ls -l` to show all defaults. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment