✨Discover storytelling in the AI age with Pixar's Matthew Luhn at Sanity Connect, May 8thβ€”register now

Error creating new project through CLI due to certificate verification issue

11 replies
Last updated: Jun 14, 2023
Im creating a new project through the CLI and I'm having the following error:

Error: unable to verify the first certificate
    at TLSSocket.onConnectSecure (node:_tls_wrap:1568:34)
    at TLSSocket.emit (node:events:511:28)
    at TLSSocket._finishInit (node:_tls_wrap:985:8)
    at ssl.onhandshakedone (node:_tls_wrap:771:12)
This is the commands and configurations used:

❯ npm -y create sanity@latest
You're setting up a new project!
We'll make sure you have an account with <http://Sanity.io|Sanity.io>. Then we'll
install an open-source JS content editor that connects to
the real-time hosted API on <http://Sanity.io|Sanity.io>. Hang on.

Press ctrl + C at any time to quit.

Prefer web interfaces to terminals?
You can also set up best practice Sanity projects with
your favorite frontends on <https://www.sanity.io/templates>

Looks like you already have a Sanity-account. Sweet!

βœ” Fetching existing projects
? Select project to use Create new project
? Your project name: ######
? Select organization to attach project to Mezcal Trascendente [######]
Your content will be stored in a dataset that can be public or private, depending on
whether you want to query your content with or without authentication.
The default dataset configuration has a public dataset named "production".
? Use the default dataset configuration? Yes
βœ” Creating dataset
? Project output path: /######
? Select project template Clean project with no predefined schemas
? Do you want to use TypeScript? Yes
βœ” Bootstrapping files from template
β ‹ Resolving latest module versions
Jun 12, 2023, 6:40 PM
πŸ‘‹ Does this error happen during the
Resolving latest module versions
Jun 12, 2023, 6:50 PM
Jun 12, 2023, 6:50 PM
What version of Node and NPM are you running? What OS are you using?
Jun 12, 2023, 6:50 PM
❯ npm --v
❯ node --version
OS: macOS 13.4
Jun 12, 2023, 6:53 PM
You may want to upgrade npm to the latest stable version.
Jun 12, 2023, 6:56 PM
upgraded my system to:
❯ node --version
❯ npm --v
Will try again
Jun 12, 2023, 7:35 PM
❯ sanity init
β•‘ ⚠  Welcome to Sanity! Looks like you're following instructions for Sanity Studio v2,  β•‘
β•‘    but the version you have installed is the latest, Sanity Studio v3.                β•‘
β•‘    In Sanity Studio v3, new projects are created with [npm create sanity@latest].     β•‘
β•‘                                                                                       β•‘
β•‘    Learn more about Sanity Studio v3: <https://www.sanity.io/help/studio-v2-vs-v3>      β•‘

? Continue creating a Sanity Studio v3 project? (Y/n) çççç
❯ npm create sanity@latest
Need to install the following packages:
Jun 12, 2023, 10:13 PM
the last line is very weird
Jun 12, 2023, 10:13 PM
returned to
sanity init
and it worked. The other command is asking me to install the other dependency that I'd never used
Jun 12, 2023, 10:17 PM
Ah, that’s required as part of the process to create a V3 studio.
Jun 12, 2023, 11:30 PM
should I installed it globally?
Jun 14, 2023, 5:46 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?