Comments (12)
Thanks for the suggestion!
It actually used to do this, but I don't like the idea of it silently switching to a different compiler from the one on your PATH
. That's the sort of thing that saves a few seconds 9 times out of 10, and then eats an entire day the 10th time because that's the last thing you'd think to check for the behavior you're seeing. 😉
For that reason I'd rather we stick to the current design.
from node-test-runner.
I understand what you mean and I'm fine with it only looking in PATH
but in this case elm-make
is indeed in my PATH, it is the default binary outside of elm-test
since I have the following in my profile file:
PATH=node_modules/.bin:$PATH
If I do which elm-make
it does give me node_modules/.bin/elm-make
, so shouldn't elm-test
find it in this particular case?
from node-test-runner.
Got it - yeah I'd expect it to.
What happens if you run the example code in the README of https://github.com/rtfeldman/node-elm-compiler - does that work?
from node-test-runner.
Hm this is what I get, but I also have elm installed globally as fallback
$ node compileHelloWorld.js
Error: You are using Elm 0.18.0, but this project is saying it needs a version
in this range: 0.17.0 <= v < 0.18.0
This means this package has not been upgraded for the newer version of Elm yet.
Check out the upgrade docs for guidance on how to get things working again:
<https://github.com/elm-lang/elm-platform/tree/master/upgrade-docs>
Finished with exit code 1
(node:44904) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Compilation failed
[...]
This is if I uninstall my global elm install:
$ node compileHelloWorld.js
Could not find Elm compiler "elm-make". Is it installed?
from node-test-runner.
from node-test-runner.
- Without
npm i elm -g
I get the same thing as above (Could not find Elm compiler) - With it seems to compile fine I think, I get a good dozen lines of JS so I think that's the expected output
- If I do
npm i elm
(locally then) I also get could not find compiler
from node-test-runner.
So here's the output I get if I try to npm install elm
without -g
:
$ which elm-make
/usr/local/bin/elm-make
$ npm remove -g elm
$ npm install elm
$ which elm-make
elm-make not found
$ npm install -g elm
/usr/local/bin/elm-make
It's definitely not ending up on my path. I'm curious why it'd be different for you... 🤔
from node-test-runner.
Because I set it up like so, I put PATH=node_modules/.bin:$PATH
in my .zprofile
file (or .bash_profile). It's a common setup to avoid having to type node_modules/.bin
all day, same for other package managers:
~/.zprofile
## Homebrew
PATH=/usr/local/bin:/usr/local/sbin:$PATH
## NPM
PATH=node_modules/.bin:$PATH
## Composer
PATH=vendor/bin:$HOME/.composer/vendor/bin:$PATH
from node-test-runner.
Ah, got it.
Okay, I wonder if somehow that PATH
is not making it into Node properly.
When you run node -p process.env.PATH
do you see node_modules/.bin
in the output?
from node-test-runner.
As far as I can see yes, so that's even weirder :D
$ node -p process.env.PATH
/Users/anahkiasen/bin:/usr/local/bin:vendor/bin:/Users/anahkiasen/.composer/vendor/bin:node_modules/.bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/anahkiasen/.composer/vendor/bin
$ node --version
v7.2.0
from node-test-runner.
Aha! This might be it: http://stackoverflow.com/questions/9679932/how-to-use-package-installed-locally-in-node-modules
When it runs elm-make
it has to set the cwd to be the directory of the elm-package.json
in question (in this case, presumably tests/elm-package.json
), so unless tests/node_modules/bin
exists, it won't be on the PATH as far as elm-test can tell.
What happens if you do npm install elm
in the tests/
directory?
from node-test-runner.
That seems to work indeed so I'm guessing that is the issue. Abridged transcript:
$ elm-test
Could not find Elm compiler "elm-make". Is it installed?
$ cd tests && npm init -y && npm i elm
$ cd ..
$ elm-test
Running 3 tests. To reproduce these results, run: elm-test --seed 1831419900
from node-test-runner.
Related Issues (20)
- Run a single specific test
- Implement test filtering HOT 2
- Detect when we run tests twice
- Crash when --output is set for `elm-test make` HOT 8
- Unable to install npm package for 0.18.13-beta4 HOT 12
- Erroneously requires indirect dependencies specified for packages during watch HOT 3
- node 10 is eol
- No output for successful test runs HOT 4
- 0.19.1-revision8 Changelog HOT 1
- Running elm-test leaves fish shell in a weird state HOT 3
- Implicitly exposed tests not found if test module contains a character literal with a unicode sequence HOT 1
- Allow running just non-fuzzed tests HOT 1
- Check if the file read/write in the dependency cache can cause issues in the solver HOT 2
- elm-test doesn't work with Yarn 2 HOT 3
- Junit reporter breaks with new error messages of elm-program-test HOT 2
- RuntimeError: unreachable HOT 14
- Print statistics/progress on signal SIGUSR1 (Linux) / SIGINFO (macOS) HOT 1
- Support --watch for "elm-test make"
- Better support for long running tests
- from 0.19.1-revision2 to 0.19.1-revision7 (btu same with 9 and 12) skip some tests running HOT 7
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 node-test-runner.