-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Install node dependencies #664
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Someday I want to know how you dug this up! Thanks! I'd appreciate if other folks check this over too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Firstly thanks for figuring this out, we were beating our heads against the wall about this (in hindsight we probably should've thought of looking at this file...). I think we actually don't need to install codecov
globally - the documentation actually suggests installing it as a dev dependency and calling it from the node_modules/.bin
folder. That seems more elegant to me (and .bin
is automatically on the path for Travis builds). So can we just remove the install
section altogether and install codecov
with --save-dev
instead?
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apologies about the travis.yml not having npm install
@cotsog, thanks for the fix.
Related to #632
Here is a great article on global node_modules: link
Three options relating to @ethanbb's review:
Option 1:
we dont need to add a nodemodule just put this in the travis.yml
curl -s https://codecov.io/bash | bash
Option 2
@ethanbb, you can install it with --save-dev
A simpler solution you may consider that does not require adding a script:
I tested this and it works.
npm install codecov --save-dev
then in the travis.yml file:
node_modules/.bin/codecov
Option 3:
"NPM has a slightly hidden feature where it adds node_modules/.bin to the front of your PATH environment variable whenever npm run script is executed.
// package.json
"scripts": {
"gulp": "gulp"
},
npm run gulp
" ~ example from that article
Let me know if these changes are confusing @cotsog, I can insert what @ethanbb is referring to as an extra commit on this pull request. or in a new request.
I recommend "Option 1" I am testing it now on my fork of the project.
OK, @MichaelDimmitt, I'd prefer just adding And when we call |
@ethanbb, node_modules/.bin gets added to the path. I changed my review a bunch but it is finally complete now. |
@MichaelDimmitt but I think Travis specifically adds |
@ethanbb, nice one! I verified this is correct with travis.yml, we can remove the global dependency and install it as a dev dependency and it will work. I agree that just using codecov under dev dependencies in the package.json is the way to go! |
@ethanbb, was mentioning travis.ci by default runs This means that if we do want to add an install section back in the future for some future install step then we have to make sure we do Myself and Ethan have both made changes, I think this is good. The alternative would be to leave the install step in the travis.yml with the added npm install so that it will never break if someone one day wants to add an additional install step. Ethan said I should post the alternative in case anyone wanted to chime in but I agree with him this is fine for now and I am going to look through the codecov wiki documentation for this project to see if there is a spot to put this information about if someone decides to add an install step with additional install commands. |
All good points. I propose we exclude our |
Yeah, it's kind of unnecessary, but it at least makes me personally feel better for now.
In some ways, the comment isn't super useful. The crisis is over, etc. On the other hand, it's a problem we ran into, so it's a problem that's out there. Maybe it's a security blanket, but I'm ok with that if others are too, and it is better than overriding the defaults. |
Does this work for you @MichaelDimmitt? |
To share the knowledge - the problem was that because of our config, specifically our To avoid this in the future - we can either to get rid of The first would be automatic, which is a plus, but which would probably mean a longer wait time for the tests to run. The second is more knowledge that would have to be spread around, but the tests would probably be faster. Unsurprisingly to the folks who know me, I'm in favor of the first option - getting rid of the cache entirely. We could probably get rid of the comment I added at that point, and not have to add a new comment about caches! I'd like to hear the thoughts of other folks, though, and maybe this should be an issue so that others can be involved in making the decision. |
No description provided.