Skip to content
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

Allow the use of a global installation of Node #294

Closed
trigaut opened this issue Nov 14, 2019 · 4 comments
Closed

Allow the use of a global installation of Node #294

trigaut opened this issue Nov 14, 2019 · 4 comments

Comments

@trigaut
Copy link
Contributor

trigaut commented Nov 14, 2019

Hi, first thanks for that great package!
I am developing a collaborative blog using JuDoc.

I may need to deploy JuDoc in a docker container with a Node.js application which has a list of dependencies in its package.json file.
I just need to run npm install in the application folder to install all the js dependencies.
This package.json is the perfect place to put the JuDoc dependency highlight.js.
However, since issue #262 and PR #263, JuDoc uses exclusively NodeJS.jl and its "julia specific" node installation, which is not convenient as I install highlight.js using my docker image "global" node install.

Are you against something like the following in the build.jl of JuDoc for people who want to choose the node install?

const NODE = begin
    if "NODE"  keys(ENV)
        ENV["NODE"]
    else
        NodeJS.nodejs_cmd()
    end
end

I tested it works.
It would be consistent with the doc troubleshooting section https://tlienart.github.io/JuDoc.jl/dev/#Troubleshooting-1.

Moreover it is related to NodeJS but the function, NodeJS.nodejs_cmd, to launch node,
errors in a docker with alpine 3.10.2 and julia1.2.0.

Building the Dockerfile:

FROM fredrikekre/julia-alpine:1.2.0 
RUN julia -e 'import Pkg; Pkg.add("NodeJS")' 
RUN julia -e 'using NodeJS; run(NodeJS.nodejs_cmd())'

returns

Step 3/3 : RUN julia -e 'using NodeJS; run(NodeJS.nodejs_cmd())'
 ---> Running in 07e33df46554
ERROR: IOError: could not spawn `/root/.julia/packages/NodeJS/rx0mH/deps/bin/node-v10.15.0-linux-x64/bin/node`: no such file or directory (ENOENT)
@tlienart
Copy link
Owner

Hey thanks a lot, I'll review your proposal asap, thanks for taking the time! (I'm keen to have an easy way for most people and a specific way for folks like you who know their way around NPM 😋)

The project sounds great btw!

@tlienart
Copy link
Owner

tlienart commented Nov 14, 2019

Ok so now with a bit more time to look at what you're suggesting, it seems perfectly reasonable, thanks a lot, would you mind opening a PR? otherwise I'll do it tomorrow (don't worry about the docs, I'm currently re-writing the whole docs in a JuDoc website so will integrate that on the way)

As a side note, I think you should report the error on Docker to the NodeJS repo!

PS: I'm keen to learn more about your collaborative blog idea; if I can help in any way or just watch as something nice happens, I'll be happy to, cheers.

@trigaut
Copy link
Contributor Author

trigaut commented Nov 15, 2019

Thanks for the answer I just did a PR !

I will investigate a bit about the NodeJS.jl error and if I don't find the error I'll report it yes!

PS: Of course I'll be happy to discuss with you about the collaborative blog we build with a colleague! I propose on the Julia slack

@tlienart
Copy link
Owner

closed by #295

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants