developit / nextjs-preact-demo

Next.js 9.3 + Preact = 21kB
https://nextjs-preact.now.sh
384 stars 25 forks source link

'Invalid dependency type requested: alias' error when installing #10

Closed bestwestern closed 4 years ago

bestwestern commented 4 years ago

I did git clone https://github.com/developit/nextjs-preact-demo.git
cd nextjs-preact-demo
npm i

Then I got:
npm ERR! Invalid dependency type requested: alias

developit commented 4 years ago

You need to be running npm 6+.

If you can't upgrade to npm 6, open the package.json in your nextjs-preact-demo folder and change these lines:

{
  "name": "nextjs-preact-demo",
  "version": "1.0.0",
  "scripts": {
    "dev": "next",
    "build": "next build && next export -o build",
    "start": "NODE_ENV=production next start"
  },
  "dependencies": {
    "next": "^9.3.1",
    "preact": "^10.3.4",
    "preact-render-to-string": "^5.1.4",
+   "preact-ssr-prepass": "^1.0.1",
    "react": "github:preact-compat/react#1.0.0",
    "react-dom": "github:preact-compat/react-dom#1.0.0",
-   "react-ssr-prepass": "npm:preact-ssr-prepass@^1.0.1"
+   "react-ssr-prepass": "gist:6759f670713"
  },
  "license": "UNLICENSE"
}
developit commented 4 years ago

If this works it might be worth using it instead of npm aliases.

bestwestern commented 4 years ago

Awesome. Thanks. That's quite a trim of next.js!