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

Running n with no argument wastes environment with node reinstallation #577

Closed
KSR-Yasuda opened this issue Aug 1, 2019 · 6 comments
Closed

Comments

@KSR-Yasuda
Copy link

Problem

Short Version

Just running n (without any arguments), it tries to re-install node.
I think this is not user expected behavior to waste environment.

Long Version

Just run n with no arguments, it shows current installed node versions.
In this case, user would not intend to refresh their environment but just see it.

It is n's new behavior since v5.0.0, isn't it? (cf. #574 (comment))

However, only running no-argument n does

  • Reinstall npm too, and may roll back npm version (If having been updated manually)
  • Raises errors in node re-installation if no root privilege

Configuration Details

npm has been updated manually.

% npm -v
6.10.2

Just run n, and it shows current installed node versions.

% n
    node/6.11.2
  ο node/10.16.1

(Enter)

Then, it tries to re-install current selected ver. of node and npm.

However, having been running n without sudo,
(1) it raises errors for access privilege.

rm: '/usr/local/lib/node_modules/npm/doc' を削除できません: 許可がありません
rm: '/usr/local/lib/node_modules/npm/scripts' を削除できません: 許可がありません
rm: '/usr/local/lib/node_modules/npm/changelogs' を削除できません: 許可がありません
rm: '/usr/local/lib/node_modules/npm/.travis.yml' を削除できません: 許可がありません
rm: '/usr/local/lib/node_modules/npm/.npmignore' を削除できません: 許可がありません

...

rm: '/usr/local/lib/node_modules/npm/doc' を削除できません: 許可がありません
rm: '/usr/local/lib/node_modules/npm/scripts' を削除できません: 許可がありません
rm: '/usr/local/lib/node_modules/npm/changelogs' を削除できません: 許可がありません
rm: '/usr/local/lib/node_modules/npm/.travis.yml' を削除できません: 許可がありません
rm: '/usr/local/lib/node_modules/npm/.npmignore' を削除できません: 許可がありません

And after that,
(2) manually updated npm is rolled back to the default ver. for the ver. of node.

% npm -v
6.9.0
@KSR-Yasuda
Copy link
Author

% n --version
5.0.1

@shadowspawn
Copy link
Collaborator

shadowspawn commented Aug 1, 2019

Thanks for the feedback.

It is n's new behavior since v5.0.0, isn't it?

Yes. The intention is you get consistent results when you perform an action that is capable of an install.

Just run n, and it shows current installed node versions.
...
(Enter)

You can hit q (for Quit) to exit the menu without doing the install. "Enter" says install the version.

In nvh I have added instructions to the menu. Do you think this would help?


    node/v6.17.1
    node/v8.0.0
    node/v10.6.0
  ο node/v10.16.0
    node/v12.6.0

Use up/down arrow keys to select a version, return key to install, q to quit

@shadowspawn
Copy link
Collaborator

I'll add the extra messaging soon.

@KSR-Yasuda
Copy link
Author

@shadowspawn

Thank you for your reply.

You can hit q (for Quit) to exit the menu without doing the install. "Enter" says install the version.

In nvh I have added instructions to the menu. Do you think this would help?


    node/v6.17.1
    node/v8.0.0
    node/v10.6.0
  ο node/v10.16.0
    node/v12.6.0

Use up/down arrow keys to select a version, return key to install, q to quit

Oh, I got it. It was version selection menu, right?
I haven't noticed up/down key to choose the version.

With this message, I can agree with this behavior.

@shadowspawn
Copy link
Collaborator

Added menu version selection prompt in v5.0.2

@KSR-Yasuda
Copy link
Author

Thanks a lot.
Now I get the update :)

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