keystatic icon indicating copy to clipboard operation
keystatic copied to clipboard

npm create command fails (Invalid package name)

Open pReya opened this issue 2 years ago • 4 comments

Tried to install Keystatic according to the Quick Start guide under this link:

https://keystatic.com/docs/quick-start

Tried running npm create @keystatic@latest and was greeted with this error:

➜  Code npm create @keystatic@latest
npm ERR! code EINVALIDPACKAGENAME
npm ERR! Invalid package name "@keystatic" of package "@keystatic@latest/create": name can only contain URL-friendly characters.

pReya avatar Jun 29 '23 07:06 pReya

Hey @pReya, can you please let us know what version of npm you are using by running npm -v ?

BarnabyBishop avatar Jul 04 '23 06:07 BarnabyBishop

Hey @pReya, can you please let us know what version of npm you are using by running npm -v ?

Sure. It's 8.6.0 – so I'm on node 18.

Thanks for pointing me in that direction. Using node 20 / npm 9 it works great. Maybe the required node version could be mentioned in the docs?

pReya avatar Jul 04 '23 09:07 pReya

Thanks for reporting back @pReya.

Oddly when I downgrade my node to 16 and npm version to 8 it still works, I have to drop to node 14/npm 6 for it to stop working.

➜ nvm use v16.13.1
Now using node v16.13.1 (npm v8.1.2)
➜ npm create @keystatic
┌  Keystatic — let's get you setup
│
│
│     +---+
│    /    |
│   /     +---+
│  +---      /
│      |    /
│      +---+
│

What OS are you using?

BarnabyBishop avatar Jul 04 '23 23:07 BarnabyBishop

Sorry, my last comment was not correct. I assumed npm 8.6.0 is part of node 18 – which is wrong. It's actually part of node 17. So the command fails on node 17 and starts working on 18.

pReya avatar Jul 05 '23 05:07 pReya