Pic-js / Pocketic: Specified CanisterId is not hosted by subnet

I try to deploy the ICP ledger canister but I get following error:

Error: Unsuccessful validation of specified ID: Specified CanisterId ryjl3-tyaaa-aaaaa-aaaba-cai is not hosted by subnet fscpm-uiaaa-aaaaa-aaaap-yai.

Anyone managed to install it?

Both create:

const LEDGER_ID = Principal.fromText('ryjl3-tyaaa-aaaaa-aaaba-cai');

await pic.createCanister({
		sender: controller.getPrincipal(),
		targetCanisterId: LEDGER_ID,
	});

Or install:

const {actor, ...rest} = await pic.setupCanister<LedgerActor>({
		idlFactory,
		wasm: destination,
		sender: controller.getPrincipal(),
		arg,
		targetCanisterId: LEDGER_ID,
	});

Same error.

Solved it.

  1. Create PicJS with NNS support
pic = await PocketIc.create(inject('PIC_URL'), {nns: true});
  1. Before creating or installing the ICP ledger, get the NNS subnet
const subnet = pic.getNnsSubnet();
  1. Use the subnet ID for installation or creation
	const {actor, ...rest} = await pic.setupCanister<LedgerActor>({
		idlFactory,
		wasm: destination,
		sender: controller.getPrincipal(),
		arg,
		targetCanisterId: LEDGER_ID,
		targetSubnetId: subnet?.id
	});