Comencé a usar fish como mi caparazón ayer, y hoy traté de ejecutar mi aplicación NextJs en la terminal usando yarn y tailwind me dio un error sobre la versión del nodo. Lo verifiqué y luego noté que la versión actual era 10.19.0.
En mi shell zsh, tengo instalados node, npm y nvm, y puedo usarlos sin ningún error, pero en mi shell fish, solo está presente el nodo. Traté de instalar nvm en la terminal con este comando:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.4/install.sh | bashy la siguiente salida fue:
=> 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⏎La última instrucción me da comandos que puedo usar para ejecutar nvm, pero cuando los ejecuto, aparece un error.
Comandos dados
export NVM_DIR="/home/gabriel/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"Producción
~/.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”Entonces, encontré dos formas,
Uno está usando nvm con solo bash. Siempre que necesite usar el comando nvm , use bash . Luego regrese a pescar y haga todo lo relacionado con el nodo, cambie el uso de nvm [versión] en bash. Luego trabaje en fish y aún usará la versión NVM sets.
Otra es instalar curl, instalar fisher, instalar el complemento bass para admitir el estilo bash en fish,
sudo apt install curl
curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher
fisher install edc/bass
Crear nvm.fish sudo nano ~/.config/fish/functions/nvm.fish
Agregue este código al archivo nvm.fish
function nvm bass source ~/.nvm/nvm.sh --no-use ';' nvm $argv endAhora, puedes usar el comando nvm en Fish