Closed ianmackenzie closed 5 years ago
Thank you for the report. I just tried with Windows 10 after having installed Elm with the official installer from https://github.com/elm/compiler/releases but I cannot reproduce the issue yet:
C:\Users\dmy\dev\elm-units>node --version
v10.14.2
C:\Users\dmy\dev\elm-units>npm --version
6.4.1
C:\Users\dmy\dev\elm-units>elm-doc-preview --version
1.0.3
C:\Users\dmy\dev\elm-units>elm-doc-preview
elm-doc-preview 1.0.3 using elm 0.19.0
Previewing ianmackenzie/elm-units 1.0.0 from C:\Users\dmy\dev\elm-units
|> building documentation
|> watching elm.json, README.md and *.elm files
Browse <http://localhost:8000> to see your documentation
node.js
and npm
?cmd.exe
to run elm-doc-preview
?0.19.0
on the line after the error is suspect as elm-doc-preview
should just print Error: unsupported Elm version ${version}
and exits. As the error would be different if elm
were not found, I believe it is found but the version string is somewhat corrupted. elm-doc-preview
first tries to run npx --no-install elm --version
in case a local elm install is used, so could you try to run npx --no-install elm --version
and copy/paste here the output please?elm --version
?I reproduced the issue with node.js
9.0.0 and npm
5.5.1, so you don't need to provide more information:
C:\Users\dmy\dev\elm-units>elm-doc-preview
Error: unsupported Elm version null
0.19.0
C:\Users\dmy\dev\elm-units>npm --version
5.5.1
C:\Users\dmy\dev\elm-units>node --version
v9.0.0
and the problem comes from this npx
output:
C:\Users\dmy\dev\elm-units>npx --no-install elm --version
npx: installed 1 in 1.827s
The "path" argument must be of type string
null
0.19.0
And this is due to this issue: https://github.com/zkat/npx/issues/144
I am investigating a fix, until then the work-around is to update node.js
or fix your PATH as explained in the issue.
This should be fixed in elm-doc-preview@1.0.4.
Thanks, just tested with 1.0.6 and it does indeed work! I'm excited to go write some docs now =)
(Apologies for not including my Node/NPM versions in the initial report, that was dumb...)
Great! I would still advise to update your node.js version if you can (or fix your PATH else as explained in https://github.com/zkat/npx/issues/144), as npx
is a convenient tool, also its incorrect way of running in your node version also slows down a little the start of elm-doc-preview
(nothing that bad though).
Note that you can also use elm-doc-preview
during a package development, as it will display compilation errors too. So you can implement the package without building manually as it will detect modifications, recompile automatically, display errors if any, or documentation else.
Thanks for the bug report.
I installed
elm-doc-preview
on Windows 10 withWhen trying to run in a package directory I get the following error message:
If it makes a difference, I installed Elm itself using the Windows installer, not via NPM - so it's on my PATH, but if
elm-doc-preview
is looking for it specifically in some Node directories then it won't find it.