Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npx elm-pages run <script name> does not work on Windows #446

Closed
MartinSStewart opened this issue Nov 28, 2023 · 1 comment
Closed

npx elm-pages run <script name> does not work on Windows #446

MartinSStewart opened this issue Nov 28, 2023 · 1 comment

Comments

@MartinSStewart
Copy link

I followed the instructions here https://elm-pages-v3.netlify.app/docs/elm-pages-scripts/#quick-start to add a script to a non-elm-pages project. When I try running it I get a JS runtime error though

Trace: Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute 
paths must be valid file:// URLs. Received protocol 'c:'

This happens for npx elm-pages run Hello, npx elm-pages run script/src/Hello.elm, npx elm-pages run C:/mypath/src/Hello.elm, and npx elm-pages run file:///C:/mypath/src/Hello.elm

@heikogoll
Copy link

I encountered the same issue and found a immediate workaround in Windows: I installed the WSL (Windows Subsystem Linux) - see https://learn.microsoft.com/en-us/windows/wsl/setup/environment
Then I installed elm, lamdera, nvm, node and elm-pages in this ubuntu distribution. All scripts work fine.
Nevertheless, would be great for windows users to fix the issue, so that it would run in native windows, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants