Node.js 如何使用Fish Shell管理我的节点版本
我昨天开始使用fish作为shell,今天我尝试在终端中使用纱线运行我的NextJs应用程序,tailwind给了我一个关于节点版本的错误。我检查了一下,然后注意到当前版本是10.19.0 在我的zsh shell中,我安装了node、npm和nvm,我可以毫无错误地使用它们,但在我的fish shell中,只有node存在。我尝试使用以下命令在终端中安装nvm:Node.js 如何使用Fish Shell管理我的节点版本,node.js,linux,shell,terminal,Node.js,Linux,Shell,Terminal,我昨天开始使用fish作为shell,今天我尝试在终端中使用纱线运行我的NextJs应用程序,tailwind给了我一个关于节点版本的错误。我检查了一下,然后注意到当前版本是10.19.0 在我的zsh shell中,我安装了node、npm和nvm,我可以毫无错误地使用它们,但在我的fish shell中,只有node存在。我尝试使用以下命令在终端中安装nvm: curl-o-https://raw.githubusercontent.com/creationix/nvm/v0.31.4/in
curl-o-https://raw.githubusercontent.com/creationix/nvm/v0.31.4/install.sh |猛击
以下输出为:
=> nvm is already installed in /home/gabriel/.nvm, trying to update using git
=> error: pathspec 'v0.31.4' did not match any file(s) known to git
=> Source string already in /home/gabriel/.profile
main: linha 293: /nvm.sh: Arquivo ou diretório não encontrado
=> Close and reopen your terminal to start using nvm or run the following to use it now:
export NVM_DIR="/home/gabriel/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm⏎
最后一条指令为我提供了可以用来运行nvm的命令,但是当我运行它们时,我得到了一个错误
发出的命令
export NVM_DIR="/home/gabriel/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
输出
~/.nvm/nvm.sh (line 942): Unexpected ')' found, expecting '}'
"${NVM_NODE_PREFIX}")
^
from sourcing file ~/.nvm/nvm.sh
called on line 185 of file /usr/share/fish/config.fish
in function '.' with arguments '/home/gabriel/.nvm/nvm.sh'
source: Error while reading file “/home/gabriel/.nvm/nvm.sh”
fish不符合POSIX。。这意味着nvm无法支持它。。规避并运行nvm