-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathcorepack.node.txt
81 lines (66 loc) · 4.55 KB
/
corepack.node.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
┏━━━━━━━━━━━━━━┓
┃ COREPACK ┃
┗━━━━━━━━━━━━━━┛
VERSION ==> #0.32.0
INSTALL ==> #Either:
# - already part of Node.js distribution
# - npm install -g corepack
# - first, must npm uninstall -g yarn pnpm
MANAGER #One of: "npm", "yarn", "pnpm"
MANAGERX #One of: "npm|npx", "yarn[pkg]", "pnpm|pnpx"
MANAGER[X]V #MANAGER[X][@VERSION]
#VERSION is latest known
# - for yarn, it is in Yarn v1
# - can use ENVVAR COREPACK_DEFAULT_TO_LATEST=0 to use internal known latest versions,
# instead of fetching that information
MANAGERVV #MANAGER@VERSION
#Can also be MANAGER@URL
# - URL points to either:
# - .js (CommonJS)
# - .tgz of a DIR with DIR/package.json with a PACKAGE.bin
# - e.g. npm tarball URL
# - allows installing Yarn v2+ with https://registry.npmjs.org/@yarnpkg/cli-dist/-/cli-dist-X.Y.Z.tgz#sha224.SHA
# - requires ENVVAR COREPACK_ENABLE_UNSAFE_CUSTOM_URLS=1
MANAGERVR #MANAGER[@RANGE]
ENVVAR COREPACK_ENV_FILE #Def: .corepack.env
#File with all COREPACK_* ENVVARs
#Can be set to 0 to disable
ENVVAR COREPACK_HOME #~/.cache/node/corepack/ or %LOCALAPPDATA%/node/corepack/
COREPACK_HOME/MANAGER/VERSION/ #Where MANAGER is cached
corepack cache clean|clear #
corepack install [MANAGERVR...] #Download MANAGERVR and cache to COREPACK_HOME
#Def MANAGERVR: PACKAGE.packageManager + PACKAGE.devEngines
--global|-g #Write|use COREPACK_HOME/lastKnownGood.json:
# - when present, pins MANAGERV's major version, instead of using latest
ENVVAR #When downloading MANAGERVR:
COREPACK_ENABLE_DOWNLOAD_PROMPT # - 1 (def with symlinks from `corepack enable`):
# - print URL
# - if interactive TTY and not CI: CLI confirmation prompt
# - 0 (def otherwise): opposite
ENVVAR COREPACK_INTEGRITY_KEYS #Unless set to 0, check npm package integrity
corepack pack MANAGERVR... #Create an archive with MANAGERGVs
--output|-o=FILE.tgz #
--json #
corepack install --global
--cache-only FILE.tgz #Like corepack install but offline, using a FILE.tgz created by corepack pack
ENVVAR COREPACK_ENABLE_NETWORK #Can be set to 0 to force offline
corepack use MANAGERVV #Set PACKAGE.packageManager (unless ENVVAR COREPACK_ENABLE_AUTO_PIN=0)
#Then do corepack install
corepack up #Do corepack install on current PACKAGE.packageManager
corepack enable [MANAGER...] #Add symlinks for pnpm|pnpx|yarn|yarnpkg inside the global Node.js binary directory
#towards shim files that call: corepack MANAGER ...
--install-directory=DIR #Global Node.js binary directory
corepack disable [MANAGER...] #Remove those symlinks
--install-directory=DIR #
corepack MANAGERXV ... #Same as running MANAGERX ... except run corepack pack if needed
PACKAGE.packageManager #'MANAGERVV'
#In package.json
#Errors when using corepack ... with a different MANAGER
# - except for npx|pnpx|yarn dlx and npm|pnpm init
# - unless ENVVAR COREPACK_ENABLE_STRICT '0'
#Pins the MANAGER's version
# - unless ENVVAR COREPACK_ENABLE_PROJECT_SPEC '0'
#Required for corepack install
ENVVAR COREPACK_NPM_USERNAME #
ENVVAR COREPACK_NPM_TOKEN #
ENVVAR COREPACK_NPM_REGISTRY #