Error with "async function*" when following Sanity CLI instructions

3 replies
Last updated: Apr 7, 2021
Hi there,I was trying to follow the instructions at:

https://www.sanity.io/docs/getting-started-with-sanity-cli I get an error to do with "async function*". Is there some tool I need to upgrade to a later version? See log below.
Kind regards
User

npm install -g @sanity/cli
/usr/local/bin/sanity -> /usr/local/lib/node_modules/@sanity/cli/bin/sanity
+ @sanity/cli@2.7.4
updated 1 package in 1.39s
bigmac:sanity chrisbulcock$ sanity init
You're setting up a new project!
We'll make sure you have an account with
Sanity.io . Then we'llinstall an open-source JS content editor that connects to
the real-time hosted API on
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://sanity.io/create
Looks like you already have a Sanity-account. Sweet!

? Select project to use kayaking [5cf43c4z]
? Select dataset to use Create new dataset
? Dataset name: ds
? Choose dataset visibility – this can be changed later Public (world readable)

✔️ Creating dataset? Project output path: /Users/chrisbulcock/Projects/sanity/y
? Select project template E-commerce (schema + sample data)
? Upload a sampling of products to go with your e-commerce schema? Yes

✔️ Bootstrapping files from template
✔️ Resolving latest module versions
✔️ Creating default project files

✔️ Saved lockfile
/Users/chrisbulcock/Projects/sanity/y/node_modules/readdir-glob/index.js:62
async function* exploreWalkAsync(dir, path, followSyslinks, useStat, shouldSkip, strict) {
^
SyntaxError: Unexpected token *
at Object.<anonymous> (~/Projects/sanity/y/node_modules/archiver/lib/core.js
:9:12)
Apr 7, 2021, 9:41 AM
What is your current NodeJS version? open terminal and type
node -v
If you have a old version upgrade to the latest “stable” version. Also, try removing the
node_modules
from the root project folder like so
rm -fr node_modules
. install all the packages once again with
yarn install
and try to run
sanity start
Apr 7, 2021, 11:32 AM
I upgraded to Node 14.16.1 everything works now. Thanks User.
Apr 7, 2021, 12:53 PM
Welcome!
Apr 7, 2021, 1:36 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?