[SOLVED] Moralis-admin-cli deploy SyntaxError: Unexpected token *

Hi, Iā€™m working through a tutorial but cannot move on due to the following error when trying to deploy on my mac. Can any please suggest what might be wrong here? Thanks in advance.

Terrys-iMac:METADATA-STATIC-APP terryl$ sudo npm install -g moralis-admin-cli
Password:
/usr/local/bin/moralis-admin-cli -> /usr/local/lib/node_modules/moralis-admin-cli/index.js

Terrys-iMac:METADATA-STATIC-APP terryl$ moralis-admin-cli deploy
/usr/local/lib/node_modules/moralis-admin-cli/node_modules/readdir-glob/index.js:62
async function* exploreWalkAsync(dir, path, followSyslinks, useStat, shouldSkip, strict) {
^

SyntaxError: Unexpected token *
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:616:28)
at Object.Module._extensionsā€¦js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object. (/usr/local/lib/node_modules/moralis-admin-cli/node_modules/archiver/lib/core.js:9:12)

what happens if you install it in a fresh folder with:

npm init --yes
npm install --save moralis-admin-cli

Thank you for the quick reply.

Tried in new folder, but sadly get the same result when trying to deployā€¦

Any other suggestions?
Thanks Terry

Terrys-iMac:METADATA-STATIC-APP2 terryl$ npm init --yes
Wrote to /Users/terryl/METADATA-STATIC-APP2/package.json:

{
ā€œnameā€: ā€œMETADATA-STATIC-APP2ā€,
ā€œversionā€: ā€œ1.0.0ā€,
ā€œdescriptionā€: ā€œā€,
ā€œmainā€: ā€œindex.jsā€,
ā€œscriptsā€: {
ā€œtestā€: ā€œecho ā€œError: no test specifiedā€ && exit 1ā€
},
ā€œkeywordsā€: [],
ā€œauthorā€: ā€œā€,
ā€œlicenseā€: ā€œISCā€
}

Terrys-iMac:METADATA-STATIC-APP2 terryl$ npm install --save moralis-admin-cli
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

  • [email protected]
    added 123 packages in 12.119s
    Terrys-iMac:METADATA-STATIC-APP2 terryl$ moralis-admin-cli deploy
    /usr/local/lib/node_modules/moralis-admin-cli/node_modules/readdir-glob/index.js:62
    async function* exploreWalkAsync(dir, path, followSyslinks, useStat, shouldSkip, strict) {
    ^

SyntaxError: Unexpected token *
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:616:28)
at Object.Module._extensionsā€¦js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object. (/usr/local/lib/node_modules/moralis-admin-cli/node_modules/archiver/lib/core.js:9:12)
Terrys-iMac:METADATA-STATIC-APP2 terryl$

it looks like it doesnā€™t recognise this syntax with *: async function* exploreWalkAsync
maybe it is something related to node version that you have
what node version you have on your system?

SOLVED. Thank you cryptokid. Updated node and hey presto everything works!