Steps to Reproduce:
nvm install 8.8.1. This creates an NVM alias for default version, as shown using nvm ls: v6.11.5
-> v8.8.1
system
default -> 8.8.1 (-> v8.8.1) <---- THIS
node -> stable (-> v8.8.1) (default)
stable -> 8.8 (-> v8.8.1) (default)
iojs -> N/A (default)
lts/* -> lts/boron (-> v6.11.5)
lts/argon -> v4.8.5 (-> N/A)
lts/boron -> v6.11.5
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.8.1 --silent` to unset it.
This error does not occur with the MacOS terminal, and can be resolved either by removing the system node and npm, or by deleting the nvm default alias.
I have tested this same setup on Ubuntu 16.04 and the error does not occur. It appears that the system copy of npm is getting invoked when nvm.sh first loads in the VS Code terminal. I suspect this has something to do with how VSCode is opening a new terminal, but it's unclear if that's really the case.
Issue also opened on NVM: https://github.com/creationix/nvm/issues/1647
Reproduces without extensions: Yes
The VS Code terminal runs a login shell by default, you can try this which may workaround the problem:
"terminal.integrated.shellArgs.osx": []
Further reading about this: https://unix.stackexchange.com/a/46856/115410
I've been running into the same issue. I'm on Sierra and the workaround from @Tyriar didn't change anything sadly 馃槥
@Tyriar @stonehippo this seems to be caused by shell levels.
NVM currently has an issue where it doesn't seem to work properly in nested shells (see https://github.com/creationix/nvm/issues/1652).
VSCode currently seems to use a nested shell for the integrated terminal (visible by running printenv SHLVL inside the integrated terminal with the result being 2) hence NVM having problems.
Ok, this doesn't sound like a VS Code issue, so I'll close it and see if NVM addresses the nested shell issue. Thanks for info, @charsleysa!
I just wrote a FAQ on the website about the proper fix for this issue: https://github.com/Microsoft/vscode-docs/blob/master/docs/editor/integrated-terminal.md#why-is-nvm-complaining-about-a-prefix-option-when-the-integrated-terminal-is-launched
Most helpful comment
The VS Code terminal runs a login shell by default, you can try this which may workaround the problem:
Further reading about this: https://unix.stackexchange.com/a/46856/115410