Comments (9)
Hi! I used elm-watch with Node.js 18 for a long time, and now I use Node.js 20 and it works fine. The tests also run Node.js 18.
Can you post more details?
from elm-watch.
I tried several Node versions and I got this weird pattern:
OK v16.14.2
Error v18.15.0
OK v18.16.0
Error v18.17.0
Error v18.17.1
Error v20.3.1
Error v20.7.0
On a MacBook Pro - Ventura 13.5.2
from elm-watch.
Huh, that’s strange.
Could you make a reproduction repo? Then I could clone it and play around as well, with the different Node.js versions you posted.
from elm-watch.
Do you mean a repo with Elm code? This is an example of a project that shows that error: https://github.com/lucamug/elm-web-components (you can run both elm-watch and a web server with cmd/start
).
But other repos have the same issue, for me. So I think is not related to the specific project. Also it is not excluded that is a specific problem of my configuration
from elm-watch.
A “reproduction repo” usually means a minimal repo that you make just to demonstrate an issue. It should contain step-by-step instructions on which terminal commands to run to reproduce.
from elm-watch.
Ok, I found the issue.
My projects install Elm inside node_folder but I assume elm-watch
use the global install.
For some reason, the global install did not work. Executing elm
just did not return anything.
Reinstalling Elm globally with npm -g install @lydell/elm
fixed the issue.
This was hard to find! I was able to notice something strange only after I tried to run "elm init" on some of the non-working Node versions.
I wonder if having elm-watch
to point to a different binary could be useful.
I expect devs that clone my projects to run "npm install" without requiring them to install Elm manually.
from elm-watch.
elm-watch tries to spawn just elm
:
Line 85 in 9d98d0e
So it’s up to you to make sure that elm
is in PATH. elm-test works that way too, and elm-review (unless I’m mistaken). The idea is that:
- If you install elm-watch globally, why wouldn’t you install elm globally as well?
- If you install elm-watch locally, you execute it with
npx
.npx
adds localnode_modules/
folders toPATH
, so both locally installed elm and globally installed elm are found.
Either way, elm-watch should never exit with “Unexpected error:” – it should print a helpful message. I tried to reproduce myself now. I made sure that elm-watch
in in PATH, but not elm
. This is what I get when running elm-watch hot
:
-- ELM NOT FOUND -------------------------
/Users/simon/stuff/elm.json
I tried to execute elm, but it does not appear to exist!
This is what the PATH environment variable looks like:
/Users/simon/.local/share/nvm/v20.5.0/bin
/Users/simon/.ghcup/bin
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/share/dotnet
Is Elm installed?
Note: If you have installed Elm locally (for example using npm or elm-tooling),
execute elm-watch using npx to make elm-watch automatically pick up that local
installation: npx elm-watch
I wonder what happens in your case? Does child_process.spawn() throw an error for some reason? I didn’t know it could. 🤔
from elm-watch.
It is a weird case where the elm
command works but nothing happens. This is what elm-review
returns:
-- UNEXPECTED ERROR ------------------------------------------------------------
I ran into an unexpected error. Please open an issue at the following link:
https://github.com/jfmengels/node-elm-review/issues/new
Please include this error message and as much detail as you can provide. If you
can, please provide a setup that makes it easy to reproduce the error. That will
make it much easier to fix the issue.
Below is the error that was encountered.
--------------------------------------------------------------------------------
undefined
and this is what elm-test
returns:
Compiling
Error attempting to run Elm compiler "/usr/local/bin/elm":
Error: spawn Unknown system error -8
from elm-watch.
Strange indeed!
- I wonder what “Unknown system error -8” means. Tried to Google it a little but nothing has come up so far.
- elm-test says
/usr/local/bin/elm
.- What happens if you execute that directly?
- What does
file /usr/local/bin/elm
say? - What does
shasum -a 256 /usr/local/bin/elm
say? - Where does that binary come from / how did you install it?
from elm-watch.
Related Issues (20)
- Running 'example-minimal' in devcontainer wsl2 - not picking up changes to *.elm HOT 2
- Runtime error after build with --optimize HOT 10
- Allow overriding the output file for a target HOT 6
- Allow building a file with the hot-reload code inserted HOT 1
- File changes made don't trigger hot reload - WSL2
- RFC: Overhaul HTTPS support HOT 13
- how would you use elm-optimize-level-2 with elm-watch? HOT 2
- Command line is too long error HOT 1
- dynamically specifying output location HOT 6
- using a known hostname but dynamic port HOT 8
- Add output to postprocess arguments HOT 2
- Permission denied when running as root HOT 2
- elm-watch hangs on error HOT 6
- watching through symlinks HOT 1
- elm-watch hangs on error in dependency stage HOT 5
- The port showing as "0" (http://localhost:0) in the terminal when elm-watch is concatenated with the "cat" command
- errors display below <dialog>s HOT 3
- Broken link in the docs
- elm-watch beta: CLI gives https:// links by default in Bun HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elm-watch.