You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would work. This is the documented way to use non-global binaries.
Actual
[11:36:29.78] Instrumenting sources...
[11:36:29.83] Running tests...
node:events:368
throw er; // Unhandled 'error' event
^
Error: spawn ./node_modules/.bin/elm-test ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
at onErrorNT (node:internal/child_process:477:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (node:internal/child_process:288:12)
at onErrorNT (node:internal/child_process:477:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn ./node_modules/.bin/elm-test',
path: './node_modules/.bin/elm-test',
spawnargs: [
'--compiler',
'/Users/rob/Projects/elm-coverage-bug/node_modules/elm-coverage/bin/fake-elm',
'tests/'
]
}
I also tried ./node_modules/.bin/elm-coverage --elm-test ./node_modules/.bin/elm-test -- --compiler ./node_modules/.bin/elm, but the only difference that made was tacking on a couple more arguments to spawnargs:
It looks like /Users/rob/Projects/elm-coverage-bug/node_modules/elm-coverage/bin/fake-elm is looking for a global elm install, but even if I npm i -g elm I get the same result for ./node_modules/.bin/elm-coverage --elm-test ./node_modules/.bin/elm-test:
[11:43:51.49] Instrumenting sources...
[11:43:51.54] Running tests...
node:events:368
throw er; // Unhandled 'error' event
^
Error: spawn ./node_modules/.bin/elm-test ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
at onErrorNT (node:internal/child_process:477:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (node:internal/child_process:288:12)
at onErrorNT (node:internal/child_process:477:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn ./node_modules/.bin/elm-test',
path: './node_modules/.bin/elm-test',
spawnargs: [
'--compiler',
'/Users/rob/Projects/elm-coverage-bug/node_modules/elm-coverage/bin/fake-elm',
'tests/'
]
}
Looking closer, it appears as though relative paths are not resolved correctly. Providing an absolute path to elm-test works.
In any case, I don't want to globally install these things because I want the versions to be pinned in each of my projects.
Additional info
% npm --version
8.1.2
The text was updated successfully, but these errors were encountered:
Looking closer, it appears as though relative paths are not resolved correctly. Providing an absolute path to elm-test works. Added this to the description, and I'm looking into a fix to allow local installs of both elm-test and elm.
I also found #20, where @zwilias recommends using npm-which to find the elm executable. Part of me wonders if we shouldn't have another argument --elm like we have --elm-test, but for my use case npm-which will work just fine.
I've created a sample project to show the problem.
STR
npm install
./node_modules/.bin/elm-coverage --elm-test ./node_modules/.bin/elm-test
Expected
It would work. This is the documented way to use non-global binaries.
Actual
I also tried
./node_modules/.bin/elm-coverage --elm-test ./node_modules/.bin/elm-test -- --compiler ./node_modules/.bin/elm
, but the only difference that made was tacking on a couple more arguments tospawnargs
:It looks like
/Users/rob/Projects/elm-coverage-bug/node_modules/elm-coverage/bin/fake-elm
is looking for a globalelm
install, but even if Inpm i -g elm
I get the same result for./node_modules/.bin/elm-coverage --elm-test ./node_modules/.bin/elm-test
:Looking closer, it appears as though relative paths are not resolved correctly. Providing an absolute path to elm-test works.
In any case, I don't want to globally install these things because I want the versions to be pinned in each of my projects.
Additional info
The text was updated successfully, but these errors were encountered: