N: Node v6.* seems to destroy n

Created on 3 May 2016  ยท  16Comments  ยท  Source: tj/n

_Sorry, hit enter too early!_

I had upgraded to v6 using n, but then the CLI interface for n breaks, with basically no cursor feedback or any feedback of any kind. Using n 5.1.1 again brings it back to normal, but something is clearly incompatible with self updating node to 6.

Most helpful comment

@timaschew n can't detect the default node version installed.
First set the current node version with n 7.9.0 and now next time, you will give n you'll get a select list with all node version installed.

All 16 comments

Hmm, I'm able to use n just fine with Node v6.2.1 on OS X 10.11. Could you let me know what OS you're running?

I'm having the same problem, the selection screen is completely blank and any arrow key presses cause a Usage: grep... message to pop up (Arch Linux, latest n, node 6.2.2).

I'm not having any issues like this on OS X, so I'm guessing it's OS-specific. Could you send me a tree of your BASE_VERSIONS_DIR (typically /usr/local/n/versions)?

/home/liam/n/versions
โ”œโ”€โ”€ io
โ””โ”€โ”€ node
โ”œโ”€โ”€ 5.5.0
โ”œโ”€โ”€ 5.9.1
โ”œโ”€โ”€ 6.2.0
โ””โ”€โ”€ 6.2.2

6 directories, 0 files

Liam

On Fri, Jun 24, 2016 at 2:09 PM, Nimit Kalra [email protected]
wrote:

I'm not having any issues like this on OS X, so I'm guessing it's
OS-specific. Could you send me a tree of your BASE_VERSIONS_DIR
(typically /usr/local/n/versions)?

โ€”
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/tj/n/issues/355#issuecomment-228434744, or mute the
thread
https://github.com/notifications/unsubscribe/AEa8SXW3DRvnGkdlQv-PoqO8298HHY7jks5qPCttgaJpZM4IWEsC
.

I'm having this issue as well. OS X El Capitan, Node v6.0.0.

Update: I used n to update node to the latest and LTS releases and removed my previous versions. Working perfectly now.

Glad you were able to find a fix, @ElegantSudo!

@MaffooBristol and @ArchimedesPi, does this method work for you?

@qw3rtman @MaffooBristol @ArchimedesPi

To add another data point to the pile, using a Bitnami AMI (basically a batteries-included Linux image for quick deployments) on Amazon Web Services it looks like the same behavior is present. The solution proposed by @ElegantSudo did not resolve the issue.

Not sure if this is related, but I noticed that after npm installing n, running $ n doesn't detect the existing node version:

not installed

Here's a gif the wacky behavior described by @MaffooBristol:

1_weirdn

@valgaze

n not detecting the "default" installed Node is actually expected behavior. n only searches for Node versions in the directory it downloads/stores Node binaries in, so it is expected to be empty (i.e: "no installed version") prior to installing a Node version with n.

Additionally, this error is especially strange since it doesn't seem like n is even updating Node (as evident when you run node -v in the second GIF). I believe this error is actually different from this issue; could you make a new issue on this (you can just copy-paste your comment)?

Thanks for bringing this to my attention, I will investigate further. ๐Ÿ‘

@qw3rtman Cool--- makes sense now that the 1st part is expected behavior.

I'll make a new issue-- update: #367

I've also noticed that it's installing directly into /usr/local, munging things up, and keeps having issues because without sudo it can't access that folder. May be a complete red herring but it definitely looks like the installation has screwed up somewhere. Any thoughts on this?

screen shot 2016-07-29 at 11 23 26

I got into similar problem this morning. and solved in an unexpected way. just sharing it.

I was upgrading yarn to the latest version using homebrew. During the progress brew also upgraded my node version. I've been using 6.9.3 on my work machine. I also have 7.3.0 installed with n for test. It automatically installed 7.7.1 for me. (I did some brew link operation according to error output from the terminal for installation failure before yarn was successfully upgraded.)

I didn't notice this until my gulp workflow broke down saying "node-sass could not find a binding ...". then I realized something must be wrong with my node. I ran node -v and it shows 7.7.1.

I tried to change that with n and found that 'grep' error. not able to choose by pressing up/down.

I thought it might have something to do with n not able to find current running version of node in the installation path. So I ran n latest to install 7.7.1 with n. and it magically solved the problem. now I got 3 versions of node and totally able to switch between them.

For me even when I remove all versions of 6, it's still broken, I already had that issue and needed to remove n including the symlinks, this is a dealbreaker! Very sad, I need to switch now to nvm

BTW: after trying to use the cursor (down/up) to switch the version, the grep help appears, see screenshot.
n-bug

What version of n are you running? This may have been resolved in n@latest because when I run this in a container, I'm not getting these issues.

@timaschew n can't detect the default node version installed.
First set the current node version with n 7.9.0 and now next time, you will give n you'll get a select list with all node version installed.

For anyone interested I was having this issue on Ubuntu 12.04 because I installed n with sudo and tried running it without sudo. Running it with sudo resolved the issue with the version selector interface.

This issue has not had any activity in over six months. It isn't likely to get acted on due to this report.

Feel free to open a new issue if it comes up again, with new information and renewed interest.

Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings