Skip to content

Conversation

PeterDaveHello
Copy link
Collaborator

Add prompt and return non-zero when there is no binary for node version greater than v1.0.0

Currently, on FreeBSD, if we try nvm install 4.2, we will only get:

Installing node v1.0 and greater from source is not currently supported

In fact I had no idea what's wrong because I didn't use -s parameter for it,
and then I found that there are two reasons:

  1. There was no pre-built nodejs binary from official for FreeBSD, which means we need to build from source.
  2. nvm doesn't support build for v1.0 and greater version from source yet.

So I think there should be a prompt message to tell the user about the reason why nvm will go to build from source, no matter it will succeed or fail.

@@ -1616,10 +1616,12 @@ nvm() {
if [ "_$NVM_OS" = "_freebsd" ]; then
# node.js and io.js do not have a FreeBSD binary
nobinary=1
echo "Currently, there is no binary for $NVM_OS"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these both should echo to stderr, not stdout

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, working on it.

@ljharb
Copy link
Member

ljharb commented Nov 9, 2015

This seems like a good approach.

@PeterDaveHello
Copy link
Collaborator Author

Updated!

@ljharb
Copy link
Member

ljharb commented Nov 9, 2015

Your description says "return nonzero" but this PR doesn't achieve that - I think just the error message is sufficient tho. Do you agree?

@PeterDaveHello
Copy link
Collaborator Author

@ljharb my fault, that's the previous version of that commit before review, thanks for your prompt reply.

@PeterDaveHello
Copy link
Collaborator Author

@ljharb is this good to merge? Thanks.

@ljharb
Copy link
Member

ljharb commented Dec 4, 2015

The tests were failing because of an SSL issue with iojs.org, but I've now disabled them in latest master. Can you rebase, and once the tests pass, I'll be happy to merge it?

@PeterDaveHello
Copy link
Collaborator Author

Of course, give me few mins.

Add prompt when there is no binary for node version greater than v1.0.0

Currently, on FreeBSD, if we try `nvm install 4.2`, we will only get:
> Installing node v1.0 and greater from source is not currently supported

In fact I had no idea what's wrong because I didn't use `-s` parameter for it,
and then I found that there are two reasons:
1. There was no pre-built nodejs binary from official for FreeBSD, which means we need to build from source.
2. nvm doesn't support build for v1.0 and greater version from source yet.

So I think there should be a prompt message to tell the user about the reason why nvm will go to build from source,
no matter it will succeed or fail.
@PeterDaveHello
Copy link
Collaborator Author

@ljharb Updated!

ljharb added a commit that referenced this pull request Dec 5, 2015
[install] on install, indicate that there's no binary for FreeBSD
@ljharb ljharb merged commit 641abc8 into nvm-sh:master Dec 5, 2015
@ljharb ljharb added OS: FreeBSD / OpenBSD installing node Issues with installing node/io.js versions. labels Dec 5, 2015
@PeterDaveHello PeterDaveHello deleted the patch-2 branch December 5, 2015 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installing node Issues with installing node/io.js versions. OS: FreeBSD / OpenBSD
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants