-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
unnecessary system node required to get past prefix error on clean install #1250
Comments
I see that your docker image is running the install script - after this runs, can you manually check the appropriate profile files (that hopefully docker is using with a login shell) for the appropriate |
the image does not contain a profile file for the in our case, we set tl;dr: the lines are not added to a profile, but are handled (and work correctly when the |
Gotcha. Can you get to a state where "nodejs" is not installed, and |
I have not tracked down the output that you asked for, but wanted to share something else that I realized. This should probably have been obvious, but since the You may have recognized this, but it did confuse me. Beyond getting us on the right track for the issue at hand, it does further highlight the need for that exit code to be non-zero. I'm still working on getting to a state where I can get the other output. Stay tuned for that. |
I'm trying to parse this out of Jenkins output, so hopefully i grabbed all the right pieces from
|
whoa, all the "none" lines are unexpected. Also, why is |
for Because alpine linux is so stripped down, it looks like it does not support the
But, then it doesn't seem to understand
|
If |
I've added the full output above for the |
also added the full output for the |
i was able to add the
|
I saw that you asked about I think the question that I have that seems more related is "why is |
Yes, that's a good question. If you |
prefix is not in the |
ok, what does |
|
any further thoughts from the latest output above? |
Yes - it looks like |
keep in mind that each time I run these commands, it creates a new container instance, so previous commands have not had any effect. which command would you expect to create these directories? |
Sorry for the miscommunication. |
Theres a lot here, so hopefully some of it will be helpful (too long to include directly in the comment, so included as a file): |
ok so… ++ npm config get prefix
/usr/bin/env: ‘node’: No such file or directory which is here. the ++ type npm
+++ npm --version
++ command printf ' (npm v)'
++ printf ' (npm v)'
+ NVM_USE_OUTPUT='Now using node v6.7.0 (npm v)' … in other words,
now for + PATH=/home/jenkins/.nvm/versions/node/v6.7.0/bin:/usr/lib/jvm/java-1.8.0-openjdk/bin:/usr/local/sbt/bin:/etc/alternatives/java_sdk_1.8.0/bin:/var/lib/jenkins/.rvm/gems/ruby-2.1.5/bin:/var/lib/jenkins/.rvm/gems/ruby-2.1.5@global/bin:/var/lib/jenkins/.rvm/rubies/ruby-2.1.5/bin:/var/lib/jenkins/.rvm/bin:/usr/local/share:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+ export PATH ^ the above should ensure that |
it looks like since |
i take it back, i was able to get the script to change directories successfully, but it confirmed that |
OK, If you then run |
solved the issue, but by swapping an alpine linux base for a debian base. the reason for the switch was due to digging into why
since it turns out that node not being available was instead a result of symbols not being available to
this is because alpine apparently uses
while i'm moving away from using alpine, i think this effort did expose a couple of things that are worth influencing enhancements of |
Thanks, that's very helpful! I'll leave this open until those have been investigated and/or addressed. Glad you got it working :-) |
Sure thing. Hopefully some of this will help the next guy at least :) Thanks for the help along the way. |
Closing for now; will leave the "info" tag on it. |
As mentioned in #1102 (comment), when running
nvm install
(after sourcing thenvm.sh
script with the--no-use
flag) from a project with an.nvmrc
file, I'm running into thenvm is not compatible with the npm config "prefix" option: currently set to ""
error on a clean image unless a systemnode
is available.For context, this is for a docker image to be used as a Jenkins agent for building node projects. However, to distill it down a bit more, this is an alpine linux docker image based on
openjdk:8-jdk-alpine
with minimal additional installations, mostly dependencies of being a Jenkins agent.No
.npmrc
is being added outside of the project being built by Jenkins and the.npmrc
for the project only containssave-exact=true
. Environment variables are only being set for Jenkins specific config and$NVM_DIR
.As soon as
nodejs
is added to the busyboxapk add
list,nvm install
completes successfully without the prefix error, but this system levelnode
installation should be unnecessary sincenvm
should be responsible for makingnode
andnpm
available to the Jenkins build.To make matters worse, the prefix failure from the
nvm install
command exits with a zero status code, so further commands chained with&&
are successfully triggered but fail becausenpm
was not made available. This certainly complicated tracking down the problem because the prefix error appeared to only be a warning. If the prefix error is enough to not makenpm
ornode
available, thenvm install
command should not exit with0
.The text was updated successfully, but these errors were encountered: