sanity-codegen
sanity-codegen copied to clipboard
Missing dependencies?
Hiya,
I am learning sanity with a basic Typescript create-next-app. I followed the installation instructions and ran yarn add --dev sanity-codegen prettier
, but it failed with Error: Cannot find module '@babel/core'
.
After cycling through attempts to run and adding missing dependencies, I found that yarn add --dev @babel/core @babel/preset-env @babel/preset-typescript @babel/preset-react jsdom
gets me a working setup so far.
I ran into Error: Cannot find module '@babel/core'
now, but it turned out to be because I was using sanity-codegen
in a bare project that missed the standard Sanity packages (@sanity/base
, @sanity/core
etc.). In a normal Sanity project, the babel packages should already be available.