Skip to content
This repository has been archived by the owner on Jan 7, 2024. It is now read-only.

Module not found error using pnpm #14

Open
valse opened this issue Jan 21, 2023 · 3 comments
Open

Module not found error using pnpm #14

valse opened this issue Jan 21, 2023 · 3 comments

Comments

@valse
Copy link

valse commented Jan 21, 2023

Hi, first of all thanks for this amazing library: I'm a huge fan of Sanity and, for a simple project, I'd like to try it with Astro!

I installed it and I'm using the pnpm package manager but, on start, I get the Cannot find module '@sanity/client' imported from 'virtual:sanity-init' error... to solve it I need to add the @sanity/client dependency manually.

I tried with yarn and it works as expected... I don't know if this is an expected behavior 🤔

Thanks
valse

@nimser
Copy link

nimser commented Feb 8, 2023

I confirm this. Also using pnpm here. Didn't fail when installing with npm instead of pnpm.

@dvsqz
Copy link

dvsqz commented Mar 19, 2023

You may need to create a .npmrc at the root of your project with the following content so that pnpm automatically installs peer dependencies:

auto-install-peers=true

Reference: pnpm/pnpm#3995 (comment)

If that doesn't work I've seen others use this:
shamefully-hoist=true

@roblet404
Copy link

Second one worked for me

shamefully-hoist=true

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants