Preact-cli: Cannot run development server in Windows 10

Created on 22 Mar 2020  路  9Comments  路  Source: preactjs/preact-cli

I Installed a vanilla global preact-cli installation on Windows 10 2004 using Node.js v12.16.1.

npm install -g preact-cli

I used the following command to create a new preact app for my blog:

preact.cmd create default blog

And then I ran the following command to start a live server for development:

npm run start

At this moment, I expected that the server would show up, but instead, the following text is printed to my powershell console:

[email protected] start C:\Users\gtbon\Code\blog
per-env

And nothing happens, I'm unsure if this is a preact or preact-cli issue, I can open in preact-cli if needed.

Most helpful comment

You can use npm run dev to bypass per-env.

The problem is in the template: https://github.com/preactjs-templates/default/issues/36

All 9 comments

Transferring this issue to preact-cli

You can use npm run dev to bypass per-env.

The problem is in the template: https://github.com/preactjs-templates/default/issues/36

Same issue here #1115

The solution by @benhormann has worked for me. Would it be possible to add this bypass to the preact-cli readme? I can submit a pull requested if this is wanted.

We talked about briefly internally and think we can just remove per-env from all templates because it doesn't provide much value

If you want to make a PR, feel free

I can work in a PR for this

I have submitted a pull request removing per-env from package.json and replacing "start" with "preact watch"

https://github.com/preactjs-templates/default/pull/40
https://github.com/preactjs-templates/typescript/pull/19

Please let me know if anything else needs to be done.

Thanks for the PRs @daniel-sudz :tada:

Should now be fixed in all templates

Was this page helpful?
0 / 5 - 0 ratings