Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

nvm is not compatible with the npm config "prefix"... #576

Closed
Edditoria opened this issue Jul 24, 2018 · 6 comments
Closed

nvm is not compatible with the npm config "prefix"... #576

Edditoria opened this issue Jul 24, 2018 · 6 comments
Labels

Comments

@Edditoria
Copy link

Edditoria commented Jul 24, 2018

When open a new terminal, the following error will occur:

nvm is not compatible with the npm config "prefix" option: currently set to "/usr/local"
Run `npm config delete prefix` or `nvm use --delete-prefix v8.11.1 --silent` to unset it.

I've found that the problem may be the $PATH that is different with Mac's Terminal.

# echo $PATH in Terminal:

/Users/Edditoria/.pyenv/shims:/Users/Edditoria/.pyenv/bin:/Users/Edditoria/.rbenv/shims:/Users/Edditoria/.nvm/versions/node/v8.11.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin

# echo $PATH in platformio-atom-ide-terminal:

/Users/Edditoria/.pyenv/shims:/Users/Edditoria/.pyenv/bin:/Users/Edditoria/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:
/opt/X11/bin:/Users/Edditoria/.pyenv/shims:/Users/Edditoria/.pyenv/bin:/Users/Edditoria/.rbenv/shims

Other than nvm is missing, you can see that .pyenv and .rbenv are duplicated in platformio-atom-ide-terminal.

What should I do to spot the problem? And how to solve it? I really want to understand why it happens.

Thanks.

@the-j0k3r
Copy link
Collaborator

So I assume if you use an external terminal this issue isnt present?

@Edditoria
Copy link
Author

Yes. No problem in Terminal

For the $PATH, it is set in .bash_profile:

# nvm for npm
export NVM_DIR=$HOME/.nvm
if [[ -s $(brew --prefix nvm)/nvm.sh ]]; then
	source $(brew --prefix nvm)/nvm.sh
fi

# rbenv for ruby
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi

# pyenv for python
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi

It seems that path of pyenv and rbenv are exported twice and doesn't export nvm.

Many thanks.

@the-j0k3r
Copy link
Collaborator

the-j0k3r commented Jul 30, 2018

@Edditoria

Thank you for that information.

Sadly, this project is no longer under active development its entered a slow maintenance mode and there are quite a few issues outstanding regarding platformio-ide-terminal internals some users experience that are unresolved.

The project needs contributors to help chip away at these issues, which means anything like your issue that can be resolved by using external terminals is very likely not on anyone's radar except the people who experience it.

I recently came across a similar issue when running npm install from within Atom platformio-ide-terminal and failed to install all packages and setup the environment as defined inproject package.json, but after using an external terminal to do that initial setup platformio-ide-terminal was able to run OK

TL:DR;
If you know of any fixes that you can share or are able to submit a PR to fix this then that would be the faster route out of your situation.

@the-j0k3r
Copy link
Collaborator

I think this is related to #546 if not an actual duplicate of, the symptoms are pretty much the same.

we wait on #585 being merged which will fix these issues.

@the-j0k3r
Copy link
Collaborator

try again with platformio-atom-ide-terminal 2.9.0 should be all fixed.

@the-j0k3r the-j0k3r added the bug label Feb 6, 2019
@the-j0k3r
Copy link
Collaborator

This should be fixed now with 2.9.0 all similar issues have disappeared =)

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

No branches or pull requests

2 participants