Skip to content

Commit fb245f6

Browse files
docs: Add package manager documentation (solana-foundation#3605)
1 parent a2a7953 commit fb245f6

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

docs/content/docs/references/anchor-toml.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,5 +219,6 @@ Override toolchain data in the workspace similar to
219219
```toml
220220
[toolchain]
221221
anchor_version = "0.31.0" # `anchor-cli` version to use(requires `avm`)
222-
solana_version = "2.1.0" # Solana version to use(applies to all Solana tools)
222+
solana_version = "2.1.0" # Solana version to use(applies to all Solana tools)
223+
package_manager = "yarn" # JS package manager to use
223224
```

docs/content/docs/updates/release-notes/0-31-0.mdx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,27 @@ various commands do this conversion automatically, meaning you'll be able to
146146
work with both specs without having to switch versions. The only exception is
147147
the `idl fetch` command, which does not convert legacy IDLs.
148148

149+
### Package manager
150+
151+
Anchor has been using `yarn` as the default JS package manager, but some people
152+
want to use other package managers. Changing the package manager to use wasn't
153+
easy, as certain commands required `yarn` to be installed to function properly.
154+
This is no longer the case, and you can simply specify the package manager to
155+
use from `Anchor.toml`:
156+
157+
```toml
158+
[toolchain]
159+
package_manager = "npm"
160+
```
161+
162+
or when creating a new workspace:
163+
164+
```
165+
anchor init <NAME> --package-manager npm
166+
```
167+
168+
Supported values: `npm`, `yarn`, `pnpm` (default: `yarn`)
169+
149170
### Shell completions
150171

151172
You can now generate shell completions, see

0 commit comments

Comments
 (0)