Comments (5)
~/.zshrc
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
# place this after nvm initialization!
autoload -U add-zsh-hook
load-nvmrc() {
local nvmrc_path
nvmrc_path="$(nvm_find_nvmrc)"
if [ -n "$nvmrc_path" ]; then
local nvmrc_node_version
nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
if [ "$nvmrc_node_version" = "N/A" ]; then
nvm install
elif [ "$nvmrc_node_version" != "$(nvm version)" ]; then
nvm use
fi
elif [ -n "$(PWD=$OLDPWD nvm_find_nvmrc)" ] && [ "$(nvm version)" != "$(nvm version default)" ]; then
echo "Reverting to nvm default version"
nvm use default
fi
}
add-zsh-hook chpwd load-nvmrc
load-nvmrc
from nvm.
Is "npm scripts" a feature built into vscode, or a plugin? Either way I think you need to file an issue there; if the vscode terminal is correct, then anything that launches a program should start in that terminal, and also be correct.
Even the autoload scripts aren't part of nvm; you're kind of on your own when you choose to use them.
from nvm.
got it
from nvm.
sorry,again。
move config about nvm in ~/.zshrc
to ~/.zprofile
, my expect will happen, just for who have this problem later.
from nvm.
@vanchKong gotcha, that means that the "run script" command isn't starting a login shell. It's still something you should file with vscode or the extension.
from nvm.
Related Issues (20)
- [spam]
- [spam]
- [spam]
- Installation failed! Failed to clone nvm repo HOT 2
- Alias Slash error HOT 4
- [spam]
- Adding nvmrc over ssh submodule is wrong HOT 9
- [spam]
- [spam]
- nvm ls-remote shows only list of iojs and no versions of node (macOS) HOT 11
- default-packages doesn't install last package in file on Mac and Raspbian 12 HOT 2
- nvm ls-remote command results in "N/A" (can't install Node 20) HOT 5
- [Feature Request]: is there an option can be used to exclude iojs? HOT 3
- Failed to install node using the install command HOT 5
- [spam]
- [spam]
- Error when using the Windows version of curl HOT 1
- [spam]
- curl-install-sh: `fatal: bad object` from git clone steps HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nvm.