{"id":14965818,"url":"https://github.com/fabioantunes/fish-nvm","last_synced_at":"2025-04-04T16:16:44.350Z","repository":{"id":40437667,"uuid":"57295514","full_name":"FabioAntunes/fish-nvm","owner":"FabioAntunes","description":"nvm wrapper for fish-shell ","archived":false,"fork":false,"pushed_at":"2024-04-17T09:51:58.000Z","size":716,"stargazers_count":525,"open_issues_count":3,"forks_count":21,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T15:09:19.878Z","etag":null,"topics":["fish","hacktoberfest","node","nodejs","npm","nvm","yarn"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FabioAntunes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-04-28T11:04:10.000Z","updated_at":"2025-03-18T11:10:24.000Z","dependencies_parsed_at":"2024-09-14T01:21:04.333Z","dependency_job_id":"b809666e-16f3-4999-b823-74a580b87bf8","html_url":"https://github.com/FabioAntunes/fish-nvm","commit_stats":{"total_commits":61,"total_committers":14,"mean_commits":4.357142857142857,"dds":0.5245901639344263,"last_synced_commit":"57ddb124cc0b6ae7e2825855dd34f33b8492a35b"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FabioAntunes%2Ffish-nvm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FabioAntunes%2Ffish-nvm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FabioAntunes%2Ffish-nvm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FabioAntunes%2Ffish-nvm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FabioAntunes","download_url":"https://codeload.github.com/FabioAntunes/fish-nvm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247208183,"owners_count":20901570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fish","hacktoberfest","node","nodejs","npm","nvm","yarn"],"created_at":"2024-09-24T13:35:22.682Z","updated_at":"2025-04-04T16:16:44.332Z","avatar_url":"https://github.com/FabioAntunes.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fish-nvm\n\n[NVM] wrapper for fish-shell.\n\n## Install\n\nMake sure you have [NVM] installed first.\n\n### With [Fisher]\n\n```fish\nfisher install FabioAntunes/fish-nvm edc/bass\n```\n\n### With [oh-my-fish]\n\n```fish\nomf install https://github.com/fabioantunes/fish-nvm\nomf install https://github.com/edc/bass\n```\n\n### With [fundle]\n\n```fish\nfundle plugin 'FabioAntunes/fish-nvm'\nfundle plugin 'edc/bass'\nfundle install\n```\n\nAdd these lines to `~/.config/fish/config.fish`\n\n```fish\nfundle plugin 'FabioAntunes/fish-nvm'\nfundle plugin 'edc/bass'\nfundle init\n```\n\n\n**fish-nvm** depends on [bass] \n\n## Usage\n\n```fish\nnvm install 6.11.1\nnvm alias default 6.11.1\n```\n\n## How it works\n\nThe way this plugin works is delaying sourcing [NVM], until we really need it. That way we don't have those annoying 1/2 seconds of delay every time we open a new terminal window/tab.\n\nBy delaying the sourcing of [NVM] **YOUR NODE BINARIES WON'T BE LOADED** until you source [NVM] or run one of the following aliases. If you want to source [NVM] every single time you open a terminal just use [bass](https://github.com/edc/bass#nvm)\n\n![fish nvm example](/../readme-images/nvm.gif?raw=true)\n\nThere are a couple of aliases already created. These will source [NVM] whenever you call them:\n* npm\n* yarn\n* node\n* nvm\n* npx\n\nWhat this means is that if you depend on other node global packages, let's say `gulp`, if you try to run `gulp` in a new window/tab you will get something like `Command unknown`.\nOne way to solve this is running `nvm use default`, or any of the aliases before using the command `gulp`. If you primarily depend on these global packages, that's far from great.\n\nOne possible way is for you to manually create your function inside `~/.config/fish/functions`, so for `gulp` would be something like this:\n\n```fish\nfunction gulp -d \"gulp task manager\" -w gulp\n  __nvm_run \"gulp\" $argv\nend\n```\n\nTo simplify this process there's an helper function on `fish-nvm` just run `nvm_alias_function name`, you can pass multiple packages names, separated by spaces:\n\n```fish\nnvm_alias_function gulp webpack grunt\n```\n\n![fish nvm example](/../readme-images/nvm_alias_function.gif?raw=true)\n\nThis will create 3 functions on your functions folder `~/.config/fish/functions`\n\nAnother common scenario is if you need to have the binary of the node or package available. For example, if you are a vim user, some plugins need access to the node binary.\nSince we only source [NVM] when we use one of the aliases, you will probably get an error saying that node isn't available\n\nAgain one possible way is for you to manually create an alias binary for `node` in the folder `/usr/local/bin`\n\n```fish\ntouch /usr/local/bin/node\n```\n\nOpen that file on your editor and paste the following:\n\n```fish\n#! /usr/bin/env fish\n\n__nvm_run \"node\" $argv\n```\n\nMake that file executable:\n\n```fish\nchmod +x /usr/local/bin/node\n```\n\nTest it\n\n```fish\nwhich node\n```\n\nTo simplify this process there's another helper function `nvm_alias_command`\n\nIf you run `nvm_alias_command` without any arguments it will create the following aliases binaries by default: \n- `npm`\n- `node`\n- `npx`\n- `yarn`\n\n![fish nvm example](/../readme-images/nvm_alias_command.gif?raw=true)\n\nTo create additional aliases, you can pass them as arguments separated by spaces\n\n```fish\nnvm_alias_command eslint prettier\n```\n\nThe default output path is `/urs/local/bin`, if you get an error message due to permissions, try running with sudo permissions:\n\n```fish\nsudo fish nvm_alias_command eslint prettier\n```\n\nTo change the default output folder, you can set a global variable:\n\n```fish\nset -g nvm_alias_output /other/path\n```\n\n## Please read these Notes:\n\nSometimes it might happen [NVM] is already sourced, with the wrong version, or not respecting your default version. Check your `~/.profile` or `~/.bashrc` or `~/.bash_profile`. If that's the case, remove the line that sources [NVM].\n\nMake sure you set a default node version or create a `.nvmrc` file on your working directory.\n**fish-nvm** will try to use the `.nvmrc` version specified, if the file exists, if there's no file it will try to use the default version.\n\nIf you don't use the `.nvmrc` file or if you don't set a default version, you will have to run `nvm use node-version` every time you open a new terminal and want to use **node** or **npm**\n\nIf you have a custom `$NVM_DIR`, please add the following line to your `~/.config/fish/config.fish`, replacing the path accordingly:\n\n```fish\nset -gx NVM_DIR /path/to/nvm\n```\n\n\nAlso, if you have a custom installation path but still set `$NVM_DIR` to default path. For example this could happen if you install [NVM] using [brew], which would install [NVM] into: `/usr/local/Cellar/nvm/%nvm_version%/nvm.sh`\n\nIf that is the case, you need to add the following line to your `~/.config/fish/config.fish`, replacing the path accordingly:\n\n```fish\nset -gx nvm_prefix /path/to/nvm\n```\n\n\n**NOTE:**\n\n**DO NOT** use a trailing slash in `NVM_DIR` variable.\nAdding it will cause error: `nvm is not compatible with the npm config \"prefix\" option`\n\n[NVM]: https://github.com/creationix/nvm\n[brew]: https://brew.sh/\n[Fisher]: https://github.com/jorgebucaran/fisher\n[oh-my-fish]: https://github.com/oh-my-fish/oh-my-fish\n[fundle]: https://github.com/danhper/fundle\n[bass]: https://github.com/edc/bass\n\n### License\n\nfish-nvm is [MIT licensed](./LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabioantunes%2Ffish-nvm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabioantunes%2Ffish-nvm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabioantunes%2Ffish-nvm/lists"}