{
    "componentChunkName": "component---src-templates-issues-tsx",
    "path": "/issues/408",
    "result": {"data":{"issuesJson":{"id":"0ab4c806-662f-58a6-a4b6-7b71115a06a5","title":"nvm-sh/nvm: 一个简单的工具，用于多个 Node 版本的管理与切换","number":408,"bodyHTML":"<div align=\"center\" dir=\"auto\">\n<p dir=\"auto\"><a target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://camo.githubusercontent.com/a15b413168923d02e21292705ceaf86b92675f98e250c5c896a02ba7504a6eae/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f67682f657279616a662f7475406d61696e2f696d672f696d6167655f32303234303432305f3231343430382e676966\"><img src=\"https://camo.githubusercontent.com/a15b413168923d02e21292705ceaf86b92675f98e250c5c896a02ba7504a6eae/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f67682f657279616a662f7475406d61696e2f696d672f696d6167655f32303234303432305f3231343430382e676966\" width=\"100%\" height=\"3\" data-animated-image=\"\" data-canonical-src=\"https://cdn.jsdelivr.net/gh/eryajf/tu@main/img/image_20240420_214408.gif\" style=\"max-width: 100%; height: auto; max-height: 3px;\"></a><br><br></p>\n<markdown-accessiblity-table><table role=\"table\">\n<thead>\n<tr>\n<th align=\"right\">Repos</th>\n<th align=\"left\"><a href=\"https://github.com/nvm-sh/nvm\">nvm-sh/nvm</a></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td align=\"right\"><strong>Views</strong></td>\n<td align=\"left\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/4aded213c7ef55bc0dc0b44dae8820c0d36925c87c5cac7b39754c343618c900/68747470733a2f2f76696577732e77686174696c656172656e65642e746f6461792f76696577732f6769746875622f6e766d2d73682f6e766d2e737667\" alt=\"views\" data-canonical-src=\"https://views.whatilearened.today/views/github/nvm-sh/nvm.svg\" style=\"max-width: 100%;\"></a></td>\n</tr>\n<tr>\n<td align=\"right\"><strong>Stars</strong></td>\n<td align=\"left\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/7434e5f96cbed726926eb9c15881439c8ed7e8abfcd911f4183660ff984d28cf/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6e766d2d73682f6e766d3f636f6c6f723d663266303864266c6f676f3d556e64657274616c65266c6f676f436f6c6f723d656234363330\" alt=\"stars\" data-canonical-src=\"https://img.shields.io/github/stars/nvm-sh/nvm?color=f2f08d&amp;logo=Undertale&amp;logoColor=eb4630\" style=\"max-width: 100%;\"></a></td>\n</tr>\n<tr>\n<td align=\"right\"><strong>Forks</strong></td>\n<td align=\"left\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/66753557a1fb878b5790d4fa253d1179049e65c5574bbe2380246e6a0e6e3f9e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f6e766d2d73682f6e766d3f636f6c6f723d626138366562266c6f676f3d48616e647368616b65266c6f676f436f6c6f723d656136616136\" alt=\"forks\" data-canonical-src=\"https://img.shields.io/github/forks/nvm-sh/nvm?color=ba86eb&amp;logo=Handshake&amp;logoColor=ea6aa6\" style=\"max-width: 100%;\"></a></td>\n</tr>\n<tr>\n<td align=\"right\"><strong>License</strong></td>\n<td align=\"left\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/676a2ef462fe0412438716c9d027684cac5b42a059b9b30b5577c9509fa50f09/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6e766d2d73682f6e766d3f6c6f676f3d64617461253341696d616765253246706e672533426261736536342532436956424f5277304b47676f414141414e53556845556741414144414141414177434159414141425841766d48414141414358424957584d41414173544141414c457745416d70775941414144336b6c45515652346e4f335953557a5555426748384a726f57567255474a66456d3773584e63534446784d544c327069347348456778654e526f77586770455742445552522532424e414e4f4b4f4b36366f6f4b4a4742586545475263574163455646475152484677516d483525324630774861655748493944554455354c356b6e6568644f62377a66652532423139636e434a47495243516945596c514237594a4979474c38616f73756c565a36695246516a69474b6b7564576735614c6c704f70704e586e665071773555304459524a6d56786a4367464633424c755a476d416f5655694b4541726d583744375553677351706f72674761336748664b34483663754262435644334771683141352532424c6745253242467749656e514d306a6f446f66714c6f48564e7742796d384370546e416d327a51713073676478624964515a556c416b7150415a3664676a303541446f59526f6f66792532466f5869726f376b3551586a4c6f70677a4b69514e6c4c4461716f4967754577426a7a7150355066446a45394479495879493633464d547751464d43567271774e61763451666f52673538514625324266724d485172454b3844546f434d714e4179574e4866786d54526f4c4f726d5352566747744466714345715a4f4851727a6f34706243557341333431365169364551394b476a6345465267484f724f4b6e5536574162396247455459656b4b7843766a546167394534706a653534446b3551503862624d4859762532464333756541654a6b50304f4778422532424a70426e4172595238455951516e6f4e31414e4661426e5050356c385372736559514c303641646b30464a5938484f5761424d6c6541486a683068506f73497a6c6f3876304125324633345a694f6548726130714b52504d5653493774762532423932747725324676687855654252713456454c674d376642714b354770526d6f514c584e7075625475367a6f4e52706754386e5051627138347764253246494375767978694b4871694e41664933774d367549684271476b4c696977414f734b44714f68743749747239567938536a52424557667941627225324668523142667056514664484a42253246423268683778376a36517077435665655951326b72554235436c636a3641326d3067576a25324244306d4c34397a573563517943484c4e37726a6c6d6d6174457958582532464372547a412532466f51785a6b576c39474a5443566f25324279546a3837253242346769504b6376307149486f344156344430565a727251493334706e70524d36357875652532467a417265453425324654253246536f676c664542794d7369517441546c4c3352414a355948725378365a44665337307337754d486842705225324659423573305057366f455270316236253246667252684b3353444c35546965364f515548516c5133735644752532427a50636b397657453973747225324236496a533967486d5750616861444a25324277434b364e494242587348423948796b587378774470686c436d416476706c6162554a4e6e5a504239342532464e7436784f6538587a4562503257684d335741673147756236744825324233513150673337365239713475716c6e6f36676448476a444f5139306562303141484d3672596975554a314f713472344656756a35765239427a4d3957674e764f7977446869495951467667626366774166774d764863615067425041253246447948476a50624e394138616d6562636477416444354e6633373574787165774e5552656f797677424958594c645170576c6877465771745061435044334173467541535636717171496c62304a766b564331464c39576b4c55556c55574b337a585a4c46432532423125324642726f46746f364f7358497545594a5034447a7a5732594656316f4a614141414141456c46546b5375516d4343\" alt=\"license\" data-canonical-src=\"https://img.shields.io/github/license/nvm-sh/nvm?logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAD3klEQVR4nO3YSUzUUBgH8JroWVrUGJfEm7sXNcSDFxMTL2pi4sHEgxeNRowXgpEWBDURR%2BNANOKOK66ooKJGBXeEGRcWAcEVFGQRHFwQmH5%2F0wHaeWHI9DUDU5L5knehdOb7zfe%2B19cnCJGIRCQiEYlQB7YJIyGL8aosulVZ6iRFQjiGKkudWg5aLlpOppNXnfPqw5U0DYRJmVxjCgFF3BLuZGmAoVUiKEArmX7D7USgsQporgGa3gHfK4H6cuBbCVD3Gqh1A5%2BLgE%2BFwIenQM0joDofqLoHVNwBym8CpTnAm2zQq0sgdxbIdQZUlAkqPAZ6dgj05ADoYRoofy%2FoXiro7k5QXjLopgzKiQNlLDaqoIguEwBjzqP5PfDjE9DyIXyI63FMTwQFMCVrqwNav4QfoRg58QF%2BfrMHQrEK8DToCMqNAyWNHfxmTRoLOrmSRVgGtDfqCEqZOHQrzo4pbCUsA3416Qi6EQ9KGjcEFRgHOrOKnU6WAb9bGETYekKxCvjTag9E4pje54Dk5QP8bbMHYv%2FC3ueAeJkP0OGxB%2BJpBnArYR8EYQQnoN1ANFaBnPP5l8SrseYQL06Adk0FJY8HOWaBMleAHjh0hPosIzlo8v0A%2F34ZiOeHra0qKRPMVSI7tv%2B92tw%2FvhxUeBRq4VELgM7fBqK5GpRmoQLXNpubTu6zoNRpgT8nPQbq84wd%2FICuvyxiKHqiNAfI3wM6uIhBqGkLiiwAOsKDqOht7Itr9Vy8SjRBEWfyAbr%2FhR1BfpVQFdHJB%2FB2hh7x7j6QpwCVeeYQ2krUB5Clcj6A2m0gWj%2BD0mL49zW5cQyCHLN7rjlmmatEyXX%2FCrTzA%2FoQxZkWl9GJTCVo%2ByTj87%2B4giPKcv0qIHo4AV4D0VZrrQI34pnpRM65xue%2FzAreE4%2FT%2FSoglfEByMsiQtATlL3RAJ5YHrSx6ZDfS70s7uMHhBpR%2FYB5s0PW6oERp1b6%2FfrRhK3SDL5Tie6OQUHQlQ3sVDu%2BzPck9vWE9str%2B6IjS9gHmWPahaDJ%2BwCK6NIBBXsHB9HykXsxwDphlCmAdvplabUJNnZPB94%2FNt6xOe8XzEbP2WhM3WAg1Gub6tH%2B3Q1Pg376R9q4uqlno6gdHGjDOQ90eb01AHM6rYiuUJ1Oq4r4FVuj5vR9BzM9WgNvOywDhiIYQFvgbcfwAfwMvHcaPgBPA%2FDyHGjPbN9A8amebcdwAdD5Nf375txqewNUReoyvwBIXYLdQpWlhwFWqtPaCPD3AsFuASV6qqqIlb0JvkVC1FL9WkLUUlUWK3zXZLFC%2B1%2FBroFto6OsXIuEYJP4DzzW2YFV1oJaAAAAAElFTkSuQmCC\" style=\"max-width: 100%;\"></a></td>\n</tr>\n<tr>\n<td align=\"right\"><strong>UpdatedAt</strong></td>\n<td align=\"left\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/855705277d9f09a816838261826de602fb724ef454c435b06dd4579886525496/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f6e766d2d73682f6e766d3f646973706c61795f74696d657374616d703d636f6d6d6974746572266c6f676f3d64617461253341696d616765253246706e672533426261736536342532436956424f5277304b47676f414141414e5355684555674141414234414141416543415941414141374d4b3669414141414358424957584d41414173544141414c457745416d7077594141414648556c45515652346e4c5658375539615678776d3236646c582532466468627825324232253246516e626b7655627264554151674a4a496655444e574454546d4f76314651554661504a346b7573725630314a7431734e70637453327533626f745a746d786439744a5346536f714b71494635625944464c436f76436c656673747a4a387758524c445a4c7a6e6b634f343535376e3364332532466e655a3472454f515a74315771462532423858467234253242664f4c4565326a6f59307a776638546f795a50766a45676b4c592532426b306d6d72584f36644b696e787a476b30666a5430782532425279723055716e6359637a4d317263347451253242497270324c4758646f344e4334567657715453373277716c632532427231334f527269364b6458646e624f484c6c776c7a4a70524b6e3657342532424b36706f4f434e6e494166486a253246253242776168495a4234764b6e715a6630714a704e49716c2532467638545530634e6c3572627963337730516e54703379324c54614a374d314e617844723266526e315370504736476961323174664533345463614f617931694d55564f5146624659714957536f31573854694156616e43306576584f4542375770313448466232327a453566714c4f433545524c515769644e614e49347545636339693768634a6c644868324e57725135674464624f6c7061756d49754c62326174415144506e7a3062384e6257636d785656524a33486d7870536377777a4f4a6d4b44524765384c6c435a444c4739673754496e5631516c376462586256316533675430574b697243466f6d6b5079767758466c5a474a4f6a563625324253743634757564445a4f55354555636f782532464d455144567674364d62634e3237593341797a687633737061557242365a3971724a534f3139657a6a387032704c426b4a792532426343484a7857493567573574636652527a31645531394766476b6f7539505a4f34736d52396a4746777065783444793362766e6d4b79706f74625531335669646a71595a68726a343972764d457425324625324659714c7a396430304e6a57253246637a67796f394f35317a7336614e6c6f354644747530445a675146686c47584a30644241446f4e6864367576703657686f617967374e394c564748386d443462253246486e667455516f4e4734764c51306769784d716c5725324234714f6a744e48446733723166365969525347785279375576714c62395534716b716e78504f4e7661356c447048723125324279794b524e4b57425a793565644d554842326d3572792532422532424551772532427a6766347a6f39253246306f634e3357527a4c4277344a2532424a7950574372716d4967475974554f735744346f785a46516f50556a4770564871493425324661666b51504336665a5165654d31253242764c7549516e6a754257514444437363726d485039656f4e5041744271664f6e5875614b25324268364a45624772732532427076764d6d78654962683836336162565065597953456f39464a48704e4d464a59253242503563575a6b6667374f3174537759436553514c54593345385130392532464256504a556c78516a7368543142736343593032723955445542667643484236367063665041336c794165336e6772332532463437584467614a7a736c7937787741364e5a746c555550437541487161536a5549502532427375653842525741432532464e6651374a5a505a35397330476a3756747049537a34685125324243706658474d4b685a63764c70554b7866574d386f68766637702532464f446a4842666356463849736b383267314648796b63564645253242555a414158343761452532464d6c34504f3530506e75683025324678346e6d637957507364774468427836436d6b4c562532466746446a594b784f4a4f4674623077517949684c39527943774b33414f664947703159464542686e4d4a634c525745624b644b516f55366e63545a6b494544696341792532463831645675454d3552775066657934784f7830496b25324649324e6e466b692532425761664f6f464959466367595a43797864376543556a626334416d46363566742532466b4d686b336f25324235686337734d4a79716a4a45477659466151464972375930775077384246415925324236253242766d6b3377367a7a5275444d6d5a5652736668385274413075455453443775434254364459514e36697665553066706b594c6a453671725672744f78654e4b553954484c5a4a396b4255324a427342685635416976422532466f4b61514e4b675043427744596149665a4334616454684f71463457454e56694c4a77566f586f62664c424b56773637414f6154734c6336355461564b32317651344c613939654b6359673576627873624f627a5451394e37554b4467554f3177446a6944494942736868357a746733396e514d4c535a4248344f7a424f55444551586d323036643366634c67737762585141345068634b336e6873775531427a3877765130395248472532466f597933656a6677424e6d746f59714c4130586741414141424a52553545726b4a676767253344253344266c6162656c3d557064617465644174\" alt=\"last-commit\" data-canonical-src=\"https://img.shields.io/github/last-commit/nvm-sh/nvm?display_timestamp=committer&amp;logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFHUlEQVR4nLVX7U9aVxwm26dlX%2Fdhbx%2B2%2FQnbkvUbrdUAQgJJIfUDNWDTTmOv1FQUFaPJ4kusrV01Jt1sNpctS2u3botZtmxd9tJSFSoqKqIF5bYDFLCovClefstzJ8wXRLDZLznkcO4557n3d3%2FneZ4rEOQZt1WqF%2B8XFr4%2BfOLEe2joY0zwf8ToyZPvjEgkLY%2Bk0mmrXO6dKinxzGk0fjT0x%2BRyr0UqncYczM1rc4tQ%2BIrp2LGXdo4NC4VvWqTS72wqlc%2Br13ORri6KdXdnbOHLlwlzJpRKn6W4%2BK6poOCNnIAfHj%2F%2BwahIZB4vKnqZf0qJpNIql%2Fv8TU0cNl5rbyc3w0QnTp3y2LTaJ7M1NaxDr2fRn1SpPG6Gia21tfE34TcaOay1iMUVOQFbFYqIWSo1W8TiAVanC0evXOEB7Wp14HFb22zE5fqLOC5ERLQWidNaNI4uEcc9i7hcJldHh2NWrQ5gDdbOlpaumIuLb2atAQDPnz0b8NbWcmxVVRJ3HmxpScwwzOJmKDRGe8LlCZDLG9g7TInV1Ql7dbXbV1e3gT0WKirCFomkPyvwXFlZGJOjV6%2BSt64uudDZOU5EUcox%2FMEQDVvt6MbcN27Y3Ayzhv3spaUrB6Z9qrJSO19ezj8p2pLBkJy%2BcCHJxWI5gW5tcfRRz1dU19GfGkou9PZO4smR9jGFwpex4Dy3bvnmKypotbU13VidjqYZhrj49rvMEt%2F%2FYqLz9d00NjW%2Fczgyo9O51zs6aNlo5FDtu0DZgQFhlGXJ0dBADoNhd6uvp6Whoayg7N9LVGH8mD4b%2FHnftUQoNG4vLQ0gixMqlW%2B4qOjtNHDg3r1f6YiRSGxRy7UvqLb9U4qkqnxPONva5lDpHr1%2ByyKRNKWBZy5edMUHB2m5ry%2B%2BEQw%2Bzgf4zo9%2F0ocN3WRzLBw4J%2BJyPWCrqmIgGYtUOsWD4oxZFQoPUjGpVHqI4%2FafkQPC6fZQeeM1%2BvLuIQnjuBWQDDCscrmHP9eoNPAtBqfOnXuaK%2Bh6JEbGrs%2BpvvMmxeIbh863abVPeYySEo9FJHpNMFJY%2BP5cWZkfg7O1tSwYCeSQLTY3E8Q09%2FBVPJUlxQjshT1BscCY02r9UDUBfvCHB66pcfPA3lyAe3ngr3%2F47XDgaJzsly7xwA6NZtlUUPCuAHqaSjUIP%2Bsue8BRWAC%2FNfQ7JZPZ59s0Gj7VtpISz4hQ%2BCpfXGMKhZcvLpUKxfWM8ohvf7p%2FODjHBfcVF8Isk82g1FHykcVFE%2BUZAAX47aE%2FMl4PO50Pnuh0%2Fx4nmcyWPsdwDhBx6CmkLV%2FgFDjYKxOJOFtb0wQyIhL9RyCwK3AOfIGp1YFEBhnMJcLRWEbKdKQoU6ncTZkIEDicAy%2F81dVuEM5RwPfey4xOx0Ik%2FI2NnFki%2BWafOoFIYFcgYZCyxd7eCUjbc4AmF65ft%2FkMhk3o%2B5hc7sMJyqjJEGvYFaQFIr7Y0wPw8BFAY%2B6%2Bvmk3w6zzRuDMmZVRsfh8RtA0uETSD7uCBT6DYQN6iveU0fpkYLjE6qrVrtOxeNKU9THLZJ9kBU2JBsBhV5AivB%2FoKaQNKgPCBwDYaIfZC4adThOqF4WENViLJwVoXobfLBKVw67AOaTsLc65TaVK21vQ4La99eKcYg5vbxsbObzTQ9N7UKDgUO1wDjiDIIBshh5ztg39nQMLSZBH4OzBOUDEQXm206d3fcLgswbXQA4PhcK3nhswU1Bz8wvQ09RHG%2FoYy3ejfwBNmtoYqLA0XgAAAABJRU5ErkJggg%3D%3D&amp;label=UpdatedAt\" style=\"max-width: 100%;\"></a></td>\n</tr>\n<tr>\n<td align=\"right\"><strong>CreatedAt</strong></td>\n<td align=\"left\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/b3bcc884584a75c39999ebbbc5bde09015abbe24d153c8826319a1b8665fb3fd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f637265617465642d61742f6e766d2d73682f6e766d3f6c6f676f3d64617461253341696d616765253246706e672533426261736536342532436956424f5277304b47676f414141414e5355684555674141414234414141416543415941414141374d4b3669414141414358424957584d41414173544141414c457745416d7077594141414648556c45515652346e4c5658375539615678776d3236646c582532466468627825324232253246516e626b7655627264554151674a4a496655444e574454546d4f76314651554661504a346b7573725630314a7431734e70637453327533626f745a746d786439744a5346536f714b71494635625944464c436f76436c656673747a4a387758524c445a4c7a6e6b634f343535376e3364332532466e655a3472454f515a74315771462532423858467234253242664f4c4565326a6f59307a776638546f795a50766a45676b4c592532426b306d6d72584f36644b696e787a476b30666a5430782532425279723055716e6359637a4d317263347451253242497270324c4758646f344e4334567657715453373277716c632532427231334f527269364b6458646e624f484c6c776c7a4a70524b6e3657342532424b36706f4f434e6e494166486a253246253242776168495a4234764b6e715a6630714a704e49716c2532467638545530634e6c3572627963337730516e54703379324c54614a374d314e617844723266526e315370504736476961323174664533345463614f617931694d55564f5146624659714957536f31573854694156616e43306576584f4542375770313448466232327a453566714c4f433545524c515769644e614e49347545636339693768634a6c644868324e57725135674464624f6c7061756d49754c62326174415144506e7a3062384e6257636d785656524a33486d7870536377777a4f4a6d4b44524765384c6c435a444c4739673754496e5631516c376462586256316533675430574b697243466f6d6b5079767758466c5a474a4f6a563625324253743634757564445a4f55354555636f782532464d455144567674364d62634e3237593341797a687633737061557242365a3971724a534f3139657a6a387032704c426b4a792532426343484a7857493567573574636652527a31645531394766476b6f7539505a4f34736d52396a4746777065783444793362766e6d4b79706f74625531335669646a71595a68726a343972764d457425324625324659714c7a396430304e6a57253246637a67796f394f35317a7336614e6c6f354644747530445a675146686c47584a30644241446f4e6864367576703657686f617967374e394c564748386d443462253246486e667455516f4e4734764c51306769784d716c5725324234714f6a744e48446733723166365969525347785279375576714c62395534716b716e78504f4e7661356c447048723125324279794b524e4b57425a793565644d554842326d3572792532422532424551772532427a6766347a6f39253246306f634e3357527a4c4277344a2532424a7950574372716d4967475974554f735744346f785a46516f50556a4770564871493425324661666b51504336665a5165654d31253242764c7549516e6a754257514444437363726d485039656f4e5041744271664f6e5875614b25324268364a45624772732532427076764d6d78654962683836336162565065597953456f39464a48704e4d464a59253242503563575a6b6667374f3174537759436553514c54593345385130392532464256504a556c78516a7368543142736343593032723955445542667643484236367063665041336c794165336e6772332532463437584467614a7a736c7937787741364e5a746c555550437541487161536a5549502532427375653842525741432532464e6651374a5a505a35397330476a3756747049537a34685125324243706658474d4b685a63764c70554b7866574d386f68766637702532464f446a4842666356463849736b383267314648796b63564645253242555a414158343761452532464d6c34504f3530506e75683025324678346e6d637957507364774468427836436d6b4c562532466746446a594b784f4a4f4674623077517949684c39527943774b33414f664947703159464542686e4d4a634c525745624b644b516f55366e63545a6b494544696341792532463831645675454d3552775066657934784f7830496b25324649324e6e466b692532425761664f6f464959466367595a43797864376543556a626334416d46363566742532466b4d686b336f25324235686337734d4a79716a4a45477659466151464972375930775077384246415925324236253242766d6b3377367a7a5275444d6d5a5652736668385274413075455453443775434254364459514e36697665553066706b594c6a453671725672744f78654e4b553954484c5a4a396b4255324a427342685635416976422532466f4b61514e4b675043427744596149665a4334616454684f71463457454e56694c4a77566f586f62664c424b56773637414f6154734c6336355461564b32317651344c613939654b6359673576627873624f627a5451394e37554b4467554f3177446a6944494942736868357a746733396e514d4c535a4248344f7a424f55444551586d323036643366634c67737762585141345068634b336e6873775531427a3877765130395248472532466f597933656a6677424e6d746f59714c4130586741414141424a52553545726b4a676767253344253344266c6162656c3d437265617465644174\" alt=\"create-at\" data-canonical-src=\"https://img.shields.io/github/created-at/nvm-sh/nvm?logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFHUlEQVR4nLVX7U9aVxwm26dlX%2Fdhbx%2B2%2FQnbkvUbrdUAQgJJIfUDNWDTTmOv1FQUFaPJ4kusrV01Jt1sNpctS2u3botZtmxd9tJSFSoqKqIF5bYDFLCovClefstzJ8wXRLDZLznkcO4557n3d3%2FneZ4rEOQZt1WqF%2B8XFr4%2BfOLEe2joY0zwf8ToyZPvjEgkLY%2Bk0mmrXO6dKinxzGk0fjT0x%2BRyr0UqncYczM1rc4tQ%2BIrp2LGXdo4NC4VvWqTS72wqlc%2Br13ORri6KdXdnbOHLlwlzJpRKn6W4%2BK6poOCNnIAfHj%2F%2BwahIZB4vKnqZf0qJpNIql%2Fv8TU0cNl5rbyc3w0QnTp3y2LTaJ7M1NaxDr2fRn1SpPG6Gia21tfE34TcaOay1iMUVOQFbFYqIWSo1W8TiAVanC0evXOEB7Wp14HFb22zE5fqLOC5ERLQWidNaNI4uEcc9i7hcJldHh2NWrQ5gDdbOlpaumIuLb2atAQDPnz0b8NbWcmxVVRJ3HmxpScwwzOJmKDRGe8LlCZDLG9g7TInV1Ql7dbXbV1e3gT0WKirCFomkPyvwXFlZGJOjV6%2BSt64uudDZOU5EUcox%2FMEQDVvt6MbcN27Y3Ayzhv3spaUrB6Z9qrJSO19ezj8p2pLBkJy%2BcCHJxWI5gW5tcfRRz1dU19GfGkou9PZO4smR9jGFwpex4Dy3bvnmKypotbU13VidjqYZhrj49rvMEt%2F%2FYqLz9d00NjW%2Fczgyo9O51zs6aNlo5FDtu0DZgQFhlGXJ0dBADoNhd6uvp6Whoayg7N9LVGH8mD4b%2FHnftUQoNG4vLQ0gixMqlW%2B4qOjtNHDg3r1f6YiRSGxRy7UvqLb9U4qkqnxPONva5lDpHr1%2ByyKRNKWBZy5edMUHB2m5ry%2B%2BEQw%2Bzgf4zo9%2F0ocN3WRzLBw4J%2BJyPWCrqmIgGYtUOsWD4oxZFQoPUjGpVHqI4%2FafkQPC6fZQeeM1%2BvLuIQnjuBWQDDCscrmHP9eoNPAtBqfOnXuaK%2Bh6JEbGrs%2BpvvMmxeIbh863abVPeYySEo9FJHpNMFJY%2BP5cWZkfg7O1tSwYCeSQLTY3E8Q09%2FBVPJUlxQjshT1BscCY02r9UDUBfvCHB66pcfPA3lyAe3ngr3%2F47XDgaJzsly7xwA6NZtlUUPCuAHqaSjUIP%2Bsue8BRWAC%2FNfQ7JZPZ59s0Gj7VtpISz4hQ%2BCpfXGMKhZcvLpUKxfWM8ohvf7p%2FODjHBfcVF8Isk82g1FHykcVFE%2BUZAAX47aE%2FMl4PO50Pnuh0%2Fx4nmcyWPsdwDhBx6CmkLV%2FgFDjYKxOJOFtb0wQyIhL9RyCwK3AOfIGp1YFEBhnMJcLRWEbKdKQoU6ncTZkIEDicAy%2F81dVuEM5RwPfey4xOx0Ik%2FI2NnFki%2BWafOoFIYFcgYZCyxd7eCUjbc4AmF65ft%2FkMhk3o%2B5hc7sMJyqjJEGvYFaQFIr7Y0wPw8BFAY%2B6%2Bvmk3w6zzRuDMmZVRsfh8RtA0uETSD7uCBT6DYQN6iveU0fpkYLjE6qrVrtOxeNKU9THLZJ9kBU2JBsBhV5AivB%2FoKaQNKgPCBwDYaIfZC4adThOqF4WENViLJwVoXobfLBKVw67AOaTsLc65TaVK21vQ4La99eKcYg5vbxsbObzTQ9N7UKDgUO1wDjiDIIBshh5ztg39nQMLSZBH4OzBOUDEQXm206d3fcLgswbXQA4PhcK3nhswU1Bz8wvQ09RHG%2FoYy3ejfwBNmtoYqLA0XgAAAABJRU5ErkJggg%3D%3D&amp;label=CreatedAt\" style=\"max-width: 100%;\"></a></td>\n</tr>\n</tbody>\n</table></markdown-accessiblity-table>\n<a href=\"https://github.com/opsre/awesome-ops\">\n</a><p dir=\"auto\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/b964a36ea4078c39f603d46a29436371c7541a2f26e0228d7b21b9d9805b43d3/68747470733a2f2f736f6369616c6966792e6769742e63692f6f707372652f617765736f6d652d6f70732f696d6167653f6465736372697074696f6e3d3126666f6e743d42697474657226666f726b733d31266973737565733d31266c616e67756167653d31266c6f676f3d6874747073253341253246253246617661746172732e67697468756275736572636f6e74656e742e636f6d25324675253246313838353638303230266e616d653d31266f776e65723d31267061747465726e3d436972637569742b426f6172642670756c6c733d31267374617267617a6572733d31267468656d653d4c69676874\" alt=\"\" data-canonical-src=\"https://socialify.git.ci/opsre/awesome-ops/image?description=1&amp;font=Bitter&amp;forks=1&amp;issues=1&amp;language=1&amp;logo=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F188568020&amp;name=1&amp;owner=1&amp;pattern=Circuit+Board&amp;pulls=1&amp;stargazers=1&amp;theme=Light\" style=\"max-width: 100%;\"></a></p>\n<a target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://camo.githubusercontent.com/a15b413168923d02e21292705ceaf86b92675f98e250c5c896a02ba7504a6eae/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f67682f657279616a662f7475406d61696e2f696d672f696d6167655f32303234303432305f3231343430382e676966\"><img src=\"https://camo.githubusercontent.com/a15b413168923d02e21292705ceaf86b92675f98e250c5c896a02ba7504a6eae/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f67682f657279616a662f7475406d61696e2f696d672f696d6167655f32303234303432305f3231343430382e676966\" width=\"100%\" height=\"3\" data-animated-image=\"\" data-canonical-src=\"https://cdn.jsdelivr.net/gh/eryajf/tu@main/img/image_20240420_214408.gif\" style=\"max-width: 100%; height: auto; max-height: 3px;\"></a>\n</div>\n<a href=\"https://github.com/nvm-sh/logos\">\n  <themed-picture data-catalyst-inline=\"true\"><picture>\n    <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/nvm-sh/logos/HEAD/nvm-logo-white.svg\">\n    <img src=\"https://raw.githubusercontent.com/nvm-sh/logos/HEAD/nvm-logo-color.svg\" height=\"50\" alt=\"nvm project logo\">\n  </picture></themed-picture>\n</a>\n<h1 dir=\"auto\">Node Version Manager <a href=\"https://app.travis-ci.com/nvm-sh/nvm\" rel=\"nofollow\"><img src=\"https://camo.githubusercontent.com/8a042189204d0a496b06c9c51d54b87f8912d907d5ddefcaa801e017548158ab/68747470733a2f2f6170702e7472617669732d63692e636f6d2f6e766d2d73682f6e766d2e7376673f6272616e63683d6d6173746572\" alt=\"Build Status\" data-canonical-src=\"https://app.travis-ci.com/nvm-sh/nvm.svg?branch=master\" style=\"max-width: 100%;\"></a> <a href=\"https://github.com/nvm-sh/nvm/releases/tag/v0.40.3\"><img src=\"https://camo.githubusercontent.com/b19fecde45dc62c3a890f8a60c2b204e6f9f692c11f12cc7b69317d0bb5d3eea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d76302e34302e332d79656c6c6f772e737667\" alt=\"nvm version\" data-canonical-src=\"https://img.shields.io/badge/version-v0.40.3-yellow.svg\" style=\"max-width: 100%;\"></a> <a href=\"https://bestpractices.dev/projects/684\" rel=\"nofollow\"><img src=\"https://camo.githubusercontent.com/56e71f5e731bbb02144c4bb3e8c964e653046aa94e20f2e654569b7b1fe2d99b/68747470733a2f2f626573747072616374696365732e6465762f70726f6a656374732f3638342f6261646765\" alt=\"CII Best Practices\" data-canonical-src=\"https://bestpractices.dev/projects/684/badge\" style=\"max-width: 100%;\"></a></h1>\n\n\n\n<h2 dir=\"auto\">Table of Contents</h2>\n<ul dir=\"auto\">\n<li><a href=\"#intro\">Intro</a></li>\n<li><a href=\"#about\">About</a></li>\n<li><a href=\"#installing-and-updating\">Installing and Updating</a>\n<ul dir=\"auto\">\n<li><a href=\"#install--update-script\">Install &amp; Update Script</a>\n<ul dir=\"auto\">\n<li><a href=\"#additional-notes\">Additional Notes</a></li>\n<li><a href=\"#installing-in-docker\">Installing in Docker</a>\n<ul dir=\"auto\">\n<li><a href=\"#installing-in-docker-for-cicd-jobs\">Installing in Docker for CICD-Jobs</a></li>\n</ul>\n</li>\n<li><a href=\"#troubleshooting-on-linux\">Troubleshooting on Linux</a></li>\n<li><a href=\"#troubleshooting-on-macos\">Troubleshooting on macOS</a></li>\n<li><a href=\"#ansible\">Ansible</a></li>\n</ul>\n</li>\n<li><a href=\"#verify-installation\">Verify Installation</a></li>\n<li><a href=\"#important-notes\">Important Notes</a></li>\n<li><a href=\"#git-install\">Git Install</a></li>\n<li><a href=\"#manual-install\">Manual Install</a></li>\n<li><a href=\"#manual-upgrade\">Manual Upgrade</a></li>\n</ul>\n</li>\n<li><a href=\"#usage\">Usage</a>\n<ul dir=\"auto\">\n<li><a href=\"#long-term-support\">Long-term Support</a></li>\n<li><a href=\"#migrating-global-packages-while-installing\">Migrating Global Packages While Installing</a></li>\n<li><a href=\"#default-global-packages-from-file-while-installing\">Default Global Packages From File While Installing</a></li>\n<li><a href=\"#iojs\">io.js</a></li>\n<li><a href=\"#system-version-of-node\">System Version of Node</a></li>\n<li><a href=\"#listing-versions\">Listing Versions</a></li>\n<li><a href=\"#setting-custom-colors\">Setting Custom Colors</a>\n<ul dir=\"auto\">\n<li><a href=\"#persisting-custom-colors\">Persisting custom colors</a></li>\n<li><a href=\"#suppressing-colorized-output\">Suppressing colorized output</a></li>\n</ul>\n</li>\n<li><a href=\"#restoring-path\">Restoring PATH</a></li>\n<li><a href=\"#set-default-node-version\">Set default node version</a></li>\n<li><a href=\"#use-a-mirror-of-node-binaries\">Use a mirror of node binaries</a>\n<ul dir=\"auto\">\n<li><a href=\"#pass-authorization-header-to-mirror\">Pass Authorization header to mirror</a></li>\n</ul>\n</li>\n<li><a href=\"#nvmrc\">.nvmrc</a></li>\n<li><a href=\"#deeper-shell-integration\">Deeper Shell Integration</a>\n<ul dir=\"auto\">\n<li><a href=\"#calling-nvm-use-automatically-in-a-directory-with-a-nvmrc-file\">Calling <code class=\"notranslate\">nvm use</code> automatically in a directory with a <code class=\"notranslate\">.nvmrc</code> file</a>\n<ul dir=\"auto\">\n<li><a href=\"#bash\">bash</a></li>\n<li><a href=\"#zsh\">zsh</a></li>\n<li><a href=\"#fish\">fish</a></li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n<li><a href=\"#running-tests\">Running Tests</a></li>\n<li><a href=\"#environment-variables\">Environment variables</a></li>\n<li><a href=\"#bash-completion\">Bash Completion</a>\n<ul dir=\"auto\">\n<li><a href=\"#usage-1\">Usage</a></li>\n</ul>\n</li>\n<li><a href=\"#compatibility-issues\">Compatibility Issues</a></li>\n<li><a href=\"#installing-nvm-on-alpine-linux\">Installing nvm on Alpine Linux</a>\n<ul dir=\"auto\">\n<li><a href=\"#alpine-linux-313\">Alpine Linux 3.13+</a></li>\n<li><a href=\"#alpine-linux-35---312\">Alpine Linux 3.5 - 3.12</a></li>\n</ul>\n</li>\n<li><a href=\"#uninstalling--removal\">Uninstalling / Removal</a>\n<ul dir=\"auto\">\n<li><a href=\"#manual-uninstall\">Manual Uninstall</a></li>\n</ul>\n</li>\n<li><a href=\"#docker-for-development-environment\">Docker For Development Environment</a></li>\n<li><a href=\"#problems\">Problems</a></li>\n<li><a href=\"#macos-troubleshooting\">macOS Troubleshooting</a></li>\n<li><a href=\"#wsl-troubleshooting\">WSL Troubleshooting</a></li>\n<li><a href=\"#maintainers\">Maintainers</a></li>\n<li><a href=\"#project-support\">Project Support</a></li>\n<li><a href=\"#enterprise-support\">Enterprise Support</a></li>\n<li><a href=\"#license\">License</a></li>\n<li><a href=\"#copyright-notice\">Copyright notice</a></li>\n</ul>\n\n<h2 dir=\"auto\">Intro</h2>\n<p dir=\"auto\"><code class=\"notranslate\">nvm</code> allows you to quickly install and use different versions of node via the command line.</p>\n<p dir=\"auto\"><strong>Example:</strong></p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"$ nvm use 16\nNow using node v16.9.1 (npm v7.21.1)\n$ node -v\nv16.9.1\n$ nvm use 14\nNow using node v14.18.0 (npm v6.14.15)\n$ node -v\nv14.18.0\n$ nvm install 12\nNow using node v12.22.6 (npm v6.14.5)\n$ node -v\nv12.22.6\"><pre class=\"notranslate\">$ nvm use 16\nNow using node v16.9.1 (npm v7.21.1)\n$ node -v\nv16.9.1\n$ nvm use 14\nNow using node v14.18.0 (npm v6.14.15)\n$ node -v\nv14.18.0\n$ nvm install 12\nNow using node v12.22.6 (npm v6.14.5)\n$ node -v\nv12.22.6</pre></div>\n<p dir=\"auto\">Simple as that!</p>\n<h2 dir=\"auto\">About</h2>\n<p dir=\"auto\">nvm is a version manager for <a href=\"https://nodejs.org/en/\" rel=\"nofollow\">node.js</a>, designed to be installed per-user, and invoked per-shell. <code class=\"notranslate\">nvm</code> works on any POSIX-compliant shell (sh, dash, ksh, zsh, bash), in particular on these platforms: unix, macOS, and <a href=\"https://github.com/nvm-sh/nvm#important-notes\">windows WSL</a>.</p>\n<p dir=\"auto\"><a id=\"user-content-installation-and-update\"></a><br>\n<a id=\"user-content-install-script\"></a></p>\n<h2 dir=\"auto\">Installing and Updating</h2>\n<h3 dir=\"auto\">Install &amp; Update Script</h3>\n<p dir=\"auto\">To <strong>install</strong> or <strong>update</strong> nvm, you should run the <a href=\"https://github.com/nvm-sh/nvm/blob/v0.40.3/install.sh\">install script</a>. To do that, you may either download and run the script manually, or use the following cURL or Wget command:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash\"><pre class=\"notranslate\">curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh <span class=\"pl-k\">|</span> bash</pre></div>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash\"><pre class=\"notranslate\">wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh <span class=\"pl-k\">|</span> bash</pre></div>\n<p dir=\"auto\">Running either of the above commands downloads a script and runs it. The script clones the nvm repository to <code class=\"notranslate\">~/.nvm</code>, and attempts to add the source lines from the snippet below to the correct profile file (<code class=\"notranslate\">~/.bashrc</code>, <code class=\"notranslate\">~/.bash_profile</code>, <code class=\"notranslate\">~/.zshrc</code>, or <code class=\"notranslate\">~/.profile</code>). If you find the install script is updating the wrong profile file, set the <code class=\"notranslate\">$PROFILE</code> env var to the profile file’s path, and then rerun the installation script.</p>\n<p dir=\"auto\"><a id=\"user-content-profile_snippet\"></a></p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"export NVM_DIR=&quot;$([ -z &quot;${XDG_CONFIG_HOME-}&quot; ] &amp;&amp; printf %s &quot;${HOME}/.nvm&quot; || printf %s &quot;${XDG_CONFIG_HOME}/nvm&quot;)&quot;\n[ -s &quot;$NVM_DIR/nvm.sh&quot; ] &amp;&amp; \\. &quot;$NVM_DIR/nvm.sh&quot; # This loads nvm\"><pre class=\"notranslate\"><span class=\"pl-k\">export</span> NVM_DIR=<span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-s\"><span class=\"pl-pds\">$(</span>[ <span class=\"pl-k\">-z</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">${XDG_CONFIG_HOME-}</span><span class=\"pl-pds\">\"</span></span> ] <span class=\"pl-k\">&amp;&amp;</span> <span class=\"pl-c1\">printf</span> %s <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">${HOME}</span>/.nvm<span class=\"pl-pds\">\"</span></span> <span class=\"pl-k\">||</span> <span class=\"pl-c1\">printf</span> %s <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">${XDG_CONFIG_HOME}</span>/nvm<span class=\"pl-pds\">\"</span></span><span class=\"pl-pds\">)</span></span><span class=\"pl-pds\">\"</span></span>\n[ <span class=\"pl-k\">-s</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">$NVM_DIR</span>/nvm.sh<span class=\"pl-pds\">\"</span></span> ] <span class=\"pl-k\">&amp;&amp;</span> <span class=\"pl-cce\">\\.</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">$NVM_DIR</span>/nvm.sh<span class=\"pl-pds\">\"</span></span> <span class=\"pl-c\"><span class=\"pl-c\">#</span> This loads nvm</span></pre></div>\n<h4 dir=\"auto\">Additional Notes</h4>\n<ul dir=\"auto\">\n<li>\n<p dir=\"auto\">If the environment variable <code class=\"notranslate\">$XDG_CONFIG_HOME</code> is present, it will place the <code class=\"notranslate\">nvm</code> files there.</p>\n</li>\n<li>\n<p dir=\"auto\">You can add <code class=\"notranslate\">--no-use</code> to the end of the above script to postpone using <code class=\"notranslate\">nvm</code> until you manually <a href=\"#usage\"><code class=\"notranslate\">use</code></a> it:</p>\n</li>\n</ul>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"export NVM_DIR=&quot;$([ -z &quot;${XDG_CONFIG_HOME-}&quot; ] &amp;&amp; printf %s &quot;${HOME}/.nvm&quot; || printf %s &quot;${XDG_CONFIG_HOME}/nvm&quot;)&quot;\n[ -s &quot;$NVM_DIR/nvm.sh&quot; ] &amp;&amp; \\. &quot;$NVM_DIR/nvm.sh&quot; --no-use # This loads nvm, without auto-using the default version\"><pre class=\"notranslate\"><span class=\"pl-k\">export</span> NVM_DIR=<span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-s\"><span class=\"pl-pds\">$(</span>[ <span class=\"pl-k\">-z</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">${XDG_CONFIG_HOME-}</span><span class=\"pl-pds\">\"</span></span> ] <span class=\"pl-k\">&amp;&amp;</span> <span class=\"pl-c1\">printf</span> %s <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">${HOME}</span>/.nvm<span class=\"pl-pds\">\"</span></span> <span class=\"pl-k\">||</span> <span class=\"pl-c1\">printf</span> %s <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">${XDG_CONFIG_HOME}</span>/nvm<span class=\"pl-pds\">\"</span></span><span class=\"pl-pds\">)</span></span><span class=\"pl-pds\">\"</span></span>\n[ <span class=\"pl-k\">-s</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">$NVM_DIR</span>/nvm.sh<span class=\"pl-pds\">\"</span></span> ] <span class=\"pl-k\">&amp;&amp;</span> <span class=\"pl-cce\">\\.</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">$NVM_DIR</span>/nvm.sh<span class=\"pl-pds\">\"</span></span> --no-use <span class=\"pl-c\"><span class=\"pl-c\">#</span> This loads nvm, without auto-using the default version</span></pre></div>\n<ul dir=\"auto\">\n<li>\n<p dir=\"auto\">You can customize the install source, directory, profile, and version using the <code class=\"notranslate\">NVM_SOURCE</code>, <code class=\"notranslate\">NVM_DIR</code>, <code class=\"notranslate\">PROFILE</code>, and <code class=\"notranslate\">NODE_VERSION</code> variables.<br>\nEg: <code class=\"notranslate\">curl ... | NVM_DIR=\"path/to/nvm\"</code>. Ensure that the <code class=\"notranslate\">NVM_DIR</code> does not contain a trailing slash.</p>\n</li>\n<li>\n<p dir=\"auto\">The installer can use <code class=\"notranslate\">git</code>, <code class=\"notranslate\">curl</code>, or <code class=\"notranslate\">wget</code> to download <code class=\"notranslate\">nvm</code>, whichever is available.</p>\n</li>\n<li>\n<p dir=\"auto\">You can instruct the installer to not edit your shell config (for example if you already get completions via a <a href=\"https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/nvm\">zsh nvm plugin</a>) by setting <code class=\"notranslate\">PROFILE=/dev/null</code> before running the <code class=\"notranslate\">install.sh</code> script. Here's an example one-line command to do that: <code class=\"notranslate\">PROFILE=/dev/null bash -c 'curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash'</code></p>\n</li>\n</ul>\n<h4 dir=\"auto\">Installing in Docker</h4>\n<p dir=\"auto\">When invoking bash as a non-interactive shell, like in a Docker container, none of the regular profile files are sourced. In order to use <code class=\"notranslate\">nvm</code>, <code class=\"notranslate\">node</code>, and <code class=\"notranslate\">npm</code> like normal, you can instead specify the special <code class=\"notranslate\">BASH_ENV</code> variable, which bash sources when invoked non-interactively.</p>\n<div class=\"highlight highlight-source-dockerfile notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"# Use bash for the shell\nSHELL [&quot;/bin/bash&quot;, &quot;-o&quot;, &quot;pipefail&quot;, &quot;-c&quot;]\n\n# Create a script file sourced by both interactive and non-interactive bash shells\nENV BASH_ENV /home/user/.bash_env\nRUN touch &quot;${BASH_ENV}&quot;\nRUN echo '. &quot;${BASH_ENV}&quot;' &gt;&gt; ~/.bashrc\n\n# Download and install nvm\nRUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | PROFILE=&quot;${BASH_ENV}&quot; bash\nRUN echo node &gt; .nvmrc\nRUN nvm install\"><pre class=\"notranslate\"><span class=\"pl-c\"><span class=\"pl-c\">#</span> Use bash for the shell</span>\n<span class=\"pl-k\">SHELL</span> [<span class=\"pl-s\">\"/bin/bash\"</span>, <span class=\"pl-s\">\"-o\"</span>, <span class=\"pl-s\">\"pipefail\"</span>, <span class=\"pl-s\">\"-c\"</span>]\n\n<span class=\"pl-c\"><span class=\"pl-c\">#</span> Create a script file sourced by both interactive and non-interactive bash shells</span>\n<span class=\"pl-k\">ENV</span> BASH_ENV /home/user/.bash_env\n<span class=\"pl-k\">RUN</span> touch <span class=\"pl-s\">\"${BASH_ENV}\"</span>\n<span class=\"pl-k\">RUN</span> echo <span class=\"pl-s\">'. \"${BASH_ENV}\"'</span> &gt;&gt; ~/.bashrc\n\n<span class=\"pl-c\"><span class=\"pl-c\">#</span> Download and install nvm</span>\n<span class=\"pl-k\">RUN</span> curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | PROFILE=<span class=\"pl-s\">\"${BASH_ENV}\"</span> bash\n<span class=\"pl-k\">RUN</span> echo node &gt; .nvmrc\n<span class=\"pl-k\">RUN</span> nvm install</pre></div>\n<h5 dir=\"auto\">Installing in Docker for CICD-Jobs</h5>\n<p dir=\"auto\">More robust, works in CI/CD-Jobs. Can be run in interactive and non-interactive containers.<br>\nSee <a class=\"issue-link js-issue-link\" data-error-text=\"Failed to load title\" data-id=\"2866336398\" data-permission-text=\"Title is private\" data-url=\"https://github.com/nvm-sh/nvm/issues/3531\" data-hovercard-type=\"issue\" data-hovercard-url=\"/nvm-sh/nvm/issues/3531/hovercard\" href=\"https://github.com/nvm-sh/nvm/issues/3531\">nvm-sh/nvm#3531</a>.</p>\n<div class=\"highlight highlight-source-dockerfile notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"FROM ubuntu:latest\nARG NODE_VERSION=20\n\n# install curl\nRUN apt update &amp;&amp; apt install curl -y\n\n# install nvm\nRUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash\n\n# set env\nENV NVM_DIR=/root/.nvm\n\n# install node\nRUN bash -c &quot;source $NVM_DIR/nvm.sh &amp;&amp; nvm install $NODE_VERSION&quot;\n\n# set ENTRYPOINT for reloading nvm-environment\nENTRYPOINT [&quot;bash&quot;, &quot;-c&quot;, &quot;source $NVM_DIR/nvm.sh &amp;&amp; exec \\&quot;$@\\&quot;&quot;, &quot;--&quot;]\n\n# set cmd to bash\nCMD [&quot;/bin/bash&quot;]\n\"><pre class=\"notranslate\"><span class=\"pl-k\">FROM</span> ubuntu:latest\n<span class=\"pl-k\">ARG</span> NODE_VERSION=20\n\n<span class=\"pl-c\"><span class=\"pl-c\">#</span> install curl</span>\n<span class=\"pl-k\">RUN</span> apt update &amp;&amp; apt install curl -y\n\n<span class=\"pl-c\"><span class=\"pl-c\">#</span> install nvm</span>\n<span class=\"pl-k\">RUN</span> curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash\n\n<span class=\"pl-c\"><span class=\"pl-c\">#</span> set env</span>\n<span class=\"pl-k\">ENV</span> NVM_DIR=/root/.nvm\n\n<span class=\"pl-c\"><span class=\"pl-c\">#</span> install node</span>\n<span class=\"pl-k\">RUN</span> bash -c <span class=\"pl-s\">\"source $NVM_DIR/nvm.sh &amp;&amp; nvm install $NODE_VERSION\"</span>\n\n<span class=\"pl-c\"><span class=\"pl-c\">#</span> set ENTRYPOINT for reloading nvm-environment</span>\n<span class=\"pl-k\">ENTRYPOINT</span> [<span class=\"pl-s\">\"bash\"</span>, <span class=\"pl-s\">\"-c\"</span>, <span class=\"pl-s\">\"source $NVM_DIR/nvm.sh &amp;&amp; exec <span class=\"pl-c1\">\\\"</span>$@<span class=\"pl-c1\">\\\"</span>\"</span>, <span class=\"pl-s\">\"--\"</span>]\n\n<span class=\"pl-c\"><span class=\"pl-c\">#</span> set cmd to bash</span>\n<span class=\"pl-k\">CMD</span> [<span class=\"pl-s\">\"/bin/bash\"</span>]\n</pre></div>\n<p dir=\"auto\">This example defaults to installation of nodejs version 20.x.y. Optionally you can easily override the version with docker build args like:</p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"docker build -t nvmimage --build-arg NODE_VERSION=19 .\"><pre class=\"notranslate\"><code class=\"notranslate\">docker build -t nvmimage --build-arg NODE_VERSION=19 .\n</code></pre></div>\n<p dir=\"auto\">After creation of the image you can start container interactively and run commands, for example:</p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"docker run --rm -it nvmimage\n\nroot@0a6b5a237c14:/# nvm -v\n0.40.3\n\nroot@0a6b5a237c14:/# node -v\nv19.9.0\n\nroot@0a6b5a237c14:/# npm -v\n9.6.3\"><pre class=\"notranslate\"><code class=\"notranslate\">docker run --rm -it nvmimage\n\nroot@0a6b5a237c14:/# nvm -v\n0.40.3\n\nroot@0a6b5a237c14:/# node -v\nv19.9.0\n\nroot@0a6b5a237c14:/# npm -v\n9.6.3\n</code></pre></div>\n<p dir=\"auto\">Noninteractive example:</p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"user@host:/tmp/test $ docker run --rm -it nvmimage node -v\nv19.9.0\nuser@host:/tmp/test $ docker run --rm -it nvmimage npm -v\n9.6.3\"><pre class=\"notranslate\"><code class=\"notranslate\">user@host:/tmp/test $ docker run --rm -it nvmimage node -v\nv19.9.0\nuser@host:/tmp/test $ docker run --rm -it nvmimage npm -v\n9.6.3\n</code></pre></div>\n<h4 dir=\"auto\">Troubleshooting on Linux</h4>\n<p dir=\"auto\">On Linux, after running the install script, if you get <code class=\"notranslate\">nvm: command not found</code> or see no feedback from your terminal after you type <code class=\"notranslate\">command -v nvm</code>, simply close your current terminal, open a new terminal, and try verifying again.<br>\nAlternatively, you can run the following commands for the different shells on the command line:</p>\n<p dir=\"auto\"><em>bash</em>: <code class=\"notranslate\">source ~/.bashrc</code></p>\n<p dir=\"auto\"><em>zsh</em>: <code class=\"notranslate\">source ~/.zshrc</code></p>\n<p dir=\"auto\"><em>ksh</em>: <code class=\"notranslate\">. ~/.profile</code></p>\n<p dir=\"auto\">These should pick up the <code class=\"notranslate\">nvm</code> command.</p>\n<h4 dir=\"auto\">Troubleshooting on macOS</h4>\n<p dir=\"auto\">Since OS X 10.9, <code class=\"notranslate\">/usr/bin/git</code> has been preset by Xcode command line tools, which means we can't properly detect if Git is installed or not. You need to manually install the Xcode command line tools before running the install script, otherwise, it'll fail. (see <a href=\"https://github.com/nvm-sh/nvm/issues/1782\" data-hovercard-type=\"issue\" data-hovercard-url=\"/nvm-sh/nvm/issues/1782/hovercard\">#1782</a>)</p>\n<p dir=\"auto\">If you get <code class=\"notranslate\">nvm: command not found</code> after running the install script, one of the following might be the reason:</p>\n<ul dir=\"auto\">\n<li>\n<p dir=\"auto\">Since macOS 10.15, the default shell is <code class=\"notranslate\">zsh</code> and nvm will look for <code class=\"notranslate\">.zshrc</code> to update, none is installed by default. Create one with <code class=\"notranslate\">touch ~/.zshrc</code> and run the install script again.</p>\n</li>\n<li>\n<p dir=\"auto\">If you use bash, the previous default shell, your system may not have <code class=\"notranslate\">.bash_profile</code> or <code class=\"notranslate\">.bashrc</code> files where the command is set up. Create one of them with <code class=\"notranslate\">touch ~/.bash_profile</code> or <code class=\"notranslate\">touch ~/.bashrc</code> and run the install script again. Then, run <code class=\"notranslate\">. ~/.bash_profile</code> or <code class=\"notranslate\">. ~/.bashrc</code> to pick up the <code class=\"notranslate\">nvm</code> command.</p>\n</li>\n<li>\n<p dir=\"auto\">You have previously used <code class=\"notranslate\">bash</code>, but you have <code class=\"notranslate\">zsh</code> installed. You need to manually add <a href=\"#manual-install\">these lines</a> to <code class=\"notranslate\">~/.zshrc</code> and run <code class=\"notranslate\">. ~/.zshrc</code>.</p>\n</li>\n<li>\n<p dir=\"auto\">You might need to restart your terminal instance or run <code class=\"notranslate\">. ~/.nvm/nvm.sh</code>. Restarting your terminal/opening a new tab/window, or running the source command will load the command and the new configuration.</p>\n</li>\n<li>\n<p dir=\"auto\">If the above didn't help, you might need to restart your terminal instance. Try opening a new tab/window in your terminal and retry.</p>\n</li>\n</ul>\n<p dir=\"auto\">If the above doesn't fix the problem, you may try the following:</p>\n<ul dir=\"auto\">\n<li>\n<p dir=\"auto\">If you use bash, it may be that your <code class=\"notranslate\">.bash_profile</code> (or <code class=\"notranslate\">~/.profile</code>) does not source your <code class=\"notranslate\">~/.bashrc</code> properly. You could fix this by adding <code class=\"notranslate\">source ~/&lt;your_profile_file&gt;</code> to it or following the next step below.</p>\n</li>\n<li>\n<p dir=\"auto\">Try adding <a href=\"#profile_snippet\">the snippet from the install section</a>, that finds the correct nvm directory and loads nvm, to your usual profile (<code class=\"notranslate\">~/.bash_profile</code>, <code class=\"notranslate\">~/.zshrc</code>, <code class=\"notranslate\">~/.profile</code>, or <code class=\"notranslate\">~/.bashrc</code>).</p>\n</li>\n<li>\n<p dir=\"auto\">For more information about this issue and possible workarounds, please <a href=\"https://github.com/nvm-sh/nvm/issues/576\" data-hovercard-type=\"issue\" data-hovercard-url=\"/nvm-sh/nvm/issues/576/hovercard\">refer here</a></p>\n</li>\n</ul>\n<p dir=\"auto\"><strong>Note</strong> For Macs with the Apple Silicon chip, node started offering <strong>arm64</strong> arch Darwin packages since v16.0.0 and experimental <strong>arm64</strong> support when compiling from source since v14.17.0. If you are facing issues installing node using <code class=\"notranslate\">nvm</code>, you may want to update to one of those versions or later.</p>\n<h4 dir=\"auto\">Ansible</h4>\n<p dir=\"auto\">You can use a task:</p>\n<div class=\"highlight highlight-source-yaml notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"- name: Install nvm\n  ansible.builtin.shell: &gt;\n    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash\n  args:\n    creates: &quot;{{ ansible_env.HOME }}/.nvm/nvm.sh&quot;\"><pre class=\"notranslate\">- <span class=\"pl-ent\">name</span>: <span class=\"pl-s\">Install nvm</span>\n  <span class=\"pl-ent\">ansible.builtin.shell</span>: <span class=\"pl-s\">&gt;</span>\n<span class=\"pl-s\">    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash</span>\n<span class=\"pl-s\"></span>  <span class=\"pl-ent\">args</span>:\n    <span class=\"pl-ent\">creates</span>: <span class=\"pl-s\"><span class=\"pl-pds\">\"</span>{{ ansible_env.HOME }}/.nvm/nvm.sh<span class=\"pl-pds\">\"</span></span></pre></div>\n<h3 dir=\"auto\">Verify Installation</h3>\n<p dir=\"auto\">To verify that nvm has been installed, do:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"command -v nvm\"><pre class=\"notranslate\"><span class=\"pl-c1\">command</span> -v nvm</pre></div>\n<p dir=\"auto\">which should output <code class=\"notranslate\">nvm</code> if the installation was successful. Please note that <code class=\"notranslate\">which nvm</code> will not work, since <code class=\"notranslate\">nvm</code> is a sourced shell function, not an executable binary.</p>\n<p dir=\"auto\"><strong>Note:</strong> On Linux, after running the install script, if you get <code class=\"notranslate\">nvm: command not found</code> or see no feedback from your terminal after you type <code class=\"notranslate\">command -v nvm</code>, simply close your current terminal, open a new terminal, and try verifying again.</p>\n<h3 dir=\"auto\">Important Notes</h3>\n<p dir=\"auto\">If you're running a system without prepackaged binary available, which means you're going to install node or io.js from its source code, you need to make sure your system has a C++ compiler. For OS X, Xcode will work, for Debian/Ubuntu based GNU/Linux, the <code class=\"notranslate\">build-essential</code> and <code class=\"notranslate\">libssl-dev</code> packages work.</p>\n<p dir=\"auto\"><strong>Note:</strong> <code class=\"notranslate\">nvm</code> also supports Windows in some cases. It should work through WSL (Windows Subsystem for Linux) depending on the version of WSL. It should also work with <a href=\"https://gitforwindows.org/\" rel=\"nofollow\">GitBash</a> (MSYS) or <a href=\"https://cygwin.com\" rel=\"nofollow\">Cygwin</a>. Otherwise, for Windows, a few alternatives exist, which are neither supported nor developed by us:</p>\n<ul dir=\"auto\">\n<li><a href=\"https://github.com/coreybutler/nvm-windows\">nvm-windows</a></li>\n<li><a href=\"https://github.com/marcelklehr/nodist\">nodist</a></li>\n<li><a href=\"https://github.com/jasongin/nvs\">nvs</a></li>\n</ul>\n<p dir=\"auto\"><strong>Note:</strong> <code class=\"notranslate\">nvm</code> does not support <a href=\"https://fishshell.com\" rel=\"nofollow\">Fish</a> either (see <a href=\"https://github.com/nvm-sh/nvm/issues/303\" data-hovercard-type=\"issue\" data-hovercard-url=\"/nvm-sh/nvm/issues/303/hovercard\">#303</a>). Alternatives exist, which are neither supported nor developed by us:</p>\n<ul dir=\"auto\">\n<li><a href=\"https://github.com/edc/bass\">bass</a> allows you to use utilities written for Bash in fish shell</li>\n<li><a href=\"https://github.com/brigand/fast-nvm-fish\">fast-nvm-fish</a> only works with version numbers (not aliases) but doesn't significantly slow your shell startup</li>\n<li><a href=\"https://github.com/derekstavis/plugin-nvm\">plugin-nvm</a> plugin for <a href=\"https://github.com/oh-my-fish/oh-my-fish\">Oh My Fish</a>, which makes nvm and its completions available in fish shell</li>\n<li><a href=\"https://github.com/jorgebucaran/nvm.fish\">nvm.fish</a> - The Node.js version manager you'll adore, crafted just for Fish</li>\n<li><a href=\"https://github.com/FabioAntunes/fish-nvm\">fish-nvm</a> - Wrapper around nvm for fish, delays sourcing nvm until it's actually used.</li>\n</ul>\n<p dir=\"auto\"><strong>Note:</strong> We still have some problems with FreeBSD, because there is no official pre-built binary for FreeBSD, and building from source may need <a href=\"https://www.freshports.org/www/node/files/patch-deps_v8_src_base_platform_platform-posix.cc\" rel=\"nofollow\">patches</a>; see the issue ticket:</p>\n<ul dir=\"auto\">\n<li><a href=\"https://github.com/nvm-sh/nvm/issues/900\" data-hovercard-type=\"issue\" data-hovercard-url=\"/nvm-sh/nvm/issues/900/hovercard\">[#900] [Bug] node on FreeBSD may need to be patched</a></li>\n<li><a href=\"https://github.com/nodejs/node/issues/3716\" data-hovercard-type=\"issue\" data-hovercard-url=\"/nodejs/node/issues/3716/hovercard\">nodejs/node#3716</a></li>\n</ul>\n<p dir=\"auto\"><strong>Note:</strong> On OS X, if you do not have Xcode installed and you do not wish to download the ~4.3GB file, you can install the <code class=\"notranslate\">Command Line Tools</code>. You can check out this blog post on how to just that:</p>\n<ul dir=\"auto\">\n<li><a href=\"https://osxdaily.com/2014/02/12/install-command-line-tools-mac-os-x/\" rel=\"nofollow\">How to Install Command Line Tools in OS X Mavericks &amp; Yosemite (Without Xcode)</a></li>\n</ul>\n<p dir=\"auto\"><strong>Note:</strong> On OS X, if you have/had a \"system\" node installed and want to install modules globally, keep in mind that:</p>\n<ul dir=\"auto\">\n<li>When using <code class=\"notranslate\">nvm</code> you do not need <code class=\"notranslate\">sudo</code> to globally install a module with <code class=\"notranslate\">npm -g</code>, so instead of doing <code class=\"notranslate\">sudo npm install -g grunt</code>, do instead <code class=\"notranslate\">npm install -g grunt</code></li>\n<li>If you have an <code class=\"notranslate\">~/.npmrc</code> file, make sure it does not contain any <code class=\"notranslate\">prefix</code> settings (which is not compatible with <code class=\"notranslate\">nvm</code>)</li>\n<li>You can (but should not?) keep your previous \"system\" node install, but <code class=\"notranslate\">nvm</code> will only be available to your user account (the one used to install nvm). This might cause version mismatches, as other users will be using <code class=\"notranslate\">/usr/local/lib/node_modules/*</code> VS your user account using <code class=\"notranslate\">~/.nvm/versions/node/vX.X.X/lib/node_modules/*</code></li>\n</ul>\n<p dir=\"auto\">Homebrew installation is not supported. If you have issues with homebrew-installed <code class=\"notranslate\">nvm</code>, please <code class=\"notranslate\">brew uninstall</code> it, and install it using the instructions below, before filing an issue.</p>\n<p dir=\"auto\"><strong>Note:</strong> If you're using <code class=\"notranslate\">zsh</code> you can easily install <code class=\"notranslate\">nvm</code> as a zsh plugin. Install <a href=\"https://github.com/lukechilds/zsh-nvm\"><code class=\"notranslate\">zsh-nvm</code></a> and run <code class=\"notranslate\">nvm upgrade</code> to upgrade (<a href=\"https://github.com/lukechilds/zsh-nvm#auto-use\">you can set</a> <code class=\"notranslate\">NVM_AUTO_USE=true</code> to have it automatically detect and use <code class=\"notranslate\">.nvmrc</code> files).</p>\n<p dir=\"auto\"><strong>Note:</strong> Git versions before v1.7 may face a problem of cloning <code class=\"notranslate\">nvm</code> source from GitHub via https protocol, and there is also different behavior of git before v1.6, and git prior to <a href=\"https://github.com/git/git/commit/5a7d5b683f869d3e3884a89775241afa515da9e7\">v1.17.10</a> can not clone tags, so the minimum required git version is v1.7.10. If you are interested in the problem we mentioned here, please refer to GitHub's <a href=\"https://help.github.com/articles/https-cloning-errors/\">HTTPS cloning errors</a> article.</p>\n<h3 dir=\"auto\">Git Install</h3>\n<p dir=\"auto\">If you have <code class=\"notranslate\">git</code> installed (requires git v1.7.10+):</p>\n<ol dir=\"auto\">\n<li>clone this repo in the root of your user profile\n<ul dir=\"auto\">\n<li><code class=\"notranslate\">cd ~/</code> from anywhere then <code class=\"notranslate\">git clone https://github.com/nvm-sh/nvm.git .nvm</code></li>\n</ul>\n</li>\n<li><code class=\"notranslate\">cd ~/.nvm</code> and check out the latest version with <code class=\"notranslate\">git checkout v0.40.3</code></li>\n<li>activate <code class=\"notranslate\">nvm</code> by sourcing it from your shell: <code class=\"notranslate\">. ./nvm.sh</code></li>\n</ol>\n<p dir=\"auto\">Now add these lines to your <code class=\"notranslate\">~/.bashrc</code>, <code class=\"notranslate\">~/.profile</code>, or <code class=\"notranslate\">~/.zshrc</code> file to have it automatically sourced upon login:<br>\n(you may have to add to more than one of the above files)</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"export NVM_DIR=&quot;$HOME/.nvm&quot;\n[ -s &quot;$NVM_DIR/nvm.sh&quot; ] &amp;&amp; \\. &quot;$NVM_DIR/nvm.sh&quot;  # This loads nvm\n[ -s &quot;$NVM_DIR/bash_completion&quot; ] &amp;&amp; \\. &quot;$NVM_DIR/bash_completion&quot;  # This loads nvm bash_completion\"><pre class=\"notranslate\"><span class=\"pl-k\">export</span> NVM_DIR=<span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">$HOME</span>/.nvm<span class=\"pl-pds\">\"</span></span>\n[ <span class=\"pl-k\">-s</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">$NVM_DIR</span>/nvm.sh<span class=\"pl-pds\">\"</span></span> ] <span class=\"pl-k\">&amp;&amp;</span> <span class=\"pl-cce\">\\.</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">$NVM_DIR</span>/nvm.sh<span class=\"pl-pds\">\"</span></span>  <span class=\"pl-c\"><span class=\"pl-c\">#</span> This loads nvm</span>\n[ <span class=\"pl-k\">-s</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">$NVM_DIR</span>/bash_completion<span class=\"pl-pds\">\"</span></span> ] <span class=\"pl-k\">&amp;&amp;</span> <span class=\"pl-cce\">\\.</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">$NVM_DIR</span>/bash_completion<span class=\"pl-pds\">\"</span></span>  <span class=\"pl-c\"><span class=\"pl-c\">#</span> This loads nvm bash_completion</span></pre></div>\n<h3 dir=\"auto\">Manual Install</h3>\n<p dir=\"auto\">For a fully manual install, execute the following lines to first clone the <code class=\"notranslate\">nvm</code> repository into <code class=\"notranslate\">$HOME/.nvm</code>, and then load <code class=\"notranslate\">nvm</code>:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"export NVM_DIR=&quot;$HOME/.nvm&quot; &amp;&amp; (\n  git clone https://github.com/nvm-sh/nvm.git &quot;$NVM_DIR&quot;\n  cd &quot;$NVM_DIR&quot;\n  git checkout `git describe --abbrev=0 --tags --match &quot;v[0-9]*&quot; $(git rev-list --tags --max-count=1)`\n) &amp;&amp; \\. &quot;$NVM_DIR/nvm.sh&quot;\"><pre class=\"notranslate\"><span class=\"pl-k\">export</span> NVM_DIR=<span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">$HOME</span>/.nvm<span class=\"pl-pds\">\"</span></span> <span class=\"pl-k\">&amp;&amp;</span> (\n  git clone https://github.com/nvm-sh/nvm.git <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">$NVM_DIR</span><span class=\"pl-pds\">\"</span></span>\n  <span class=\"pl-c1\">cd</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">$NVM_DIR</span><span class=\"pl-pds\">\"</span></span>\n  git checkout <span class=\"pl-s\"><span class=\"pl-pds\">`</span>git describe --abbrev=0 --tags --match <span class=\"pl-s\"><span class=\"pl-pds\">\"</span>v[0-9]*<span class=\"pl-pds\">\"</span></span> <span class=\"pl-s\"><span class=\"pl-pds\">$(</span>git rev-list --tags --max-count=1<span class=\"pl-pds\">)</span></span><span class=\"pl-pds\">`</span></span>\n) <span class=\"pl-k\">&amp;&amp;</span> <span class=\"pl-cce\">\\.</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">$NVM_DIR</span>/nvm.sh<span class=\"pl-pds\">\"</span></span></pre></div>\n<p dir=\"auto\">Now add these lines to your <code class=\"notranslate\">~/.bashrc</code>, <code class=\"notranslate\">~/.profile</code>, or <code class=\"notranslate\">~/.zshrc</code> file to have it automatically sourced upon login:<br>\n(you may have to add to more than one of the above files)</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"export NVM_DIR=&quot;$HOME/.nvm&quot;\n[ -s &quot;$NVM_DIR/nvm.sh&quot; ] &amp;&amp; \\. &quot;$NVM_DIR/nvm.sh&quot; # This loads nvm\n[ -s &quot;$NVM_DIR/bash_completion&quot; ] &amp;&amp; \\. &quot;$NVM_DIR/bash_completion&quot;  # This loads nvm bash_completion\"><pre class=\"notranslate\"><span class=\"pl-k\">export</span> NVM_DIR=<span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">$HOME</span>/.nvm<span class=\"pl-pds\">\"</span></span>\n[ <span class=\"pl-k\">-s</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">$NVM_DIR</span>/nvm.sh<span class=\"pl-pds\">\"</span></span> ] <span class=\"pl-k\">&amp;&amp;</span> <span class=\"pl-cce\">\\.</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">$NVM_DIR</span>/nvm.sh<span class=\"pl-pds\">\"</span></span> <span class=\"pl-c\"><span class=\"pl-c\">#</span> This loads nvm</span>\n[ <span class=\"pl-k\">-s</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">$NVM_DIR</span>/bash_completion<span class=\"pl-pds\">\"</span></span> ] <span class=\"pl-k\">&amp;&amp;</span> <span class=\"pl-cce\">\\.</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">$NVM_DIR</span>/bash_completion<span class=\"pl-pds\">\"</span></span>  <span class=\"pl-c\"><span class=\"pl-c\">#</span> This loads nvm bash_completion</span></pre></div>\n<h3 dir=\"auto\">Manual Upgrade</h3>\n<p dir=\"auto\">For manual upgrade with <code class=\"notranslate\">git</code> (requires git v1.7.10+):</p>\n<ol dir=\"auto\">\n<li>change to the <code class=\"notranslate\">$NVM_DIR</code></li>\n<li>pull down the latest changes</li>\n<li>check out the latest version</li>\n<li>activate the new version</li>\n</ol>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"(\n  cd &quot;$NVM_DIR&quot;\n  git fetch --tags origin\n  git checkout `git describe --abbrev=0 --tags --match &quot;v[0-9]*&quot; $(git rev-list --tags --max-count=1)`\n) &amp;&amp; \\. &quot;$NVM_DIR/nvm.sh&quot;\"><pre class=\"notranslate\">(\n  <span class=\"pl-c1\">cd</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">$NVM_DIR</span><span class=\"pl-pds\">\"</span></span>\n  git fetch --tags origin\n  git checkout <span class=\"pl-s\"><span class=\"pl-pds\">`</span>git describe --abbrev=0 --tags --match <span class=\"pl-s\"><span class=\"pl-pds\">\"</span>v[0-9]*<span class=\"pl-pds\">\"</span></span> <span class=\"pl-s\"><span class=\"pl-pds\">$(</span>git rev-list --tags --max-count=1<span class=\"pl-pds\">)</span></span><span class=\"pl-pds\">`</span></span>\n) <span class=\"pl-k\">&amp;&amp;</span> <span class=\"pl-cce\">\\.</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">$NVM_DIR</span>/nvm.sh<span class=\"pl-pds\">\"</span></span></pre></div>\n<h2 dir=\"auto\">Usage</h2>\n<p dir=\"auto\">To download, compile, and install the latest release of node, do this:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"nvm install node # &quot;node&quot; is an alias for the latest version\"><pre class=\"notranslate\">nvm install node <span class=\"pl-c\"><span class=\"pl-c\">#</span> \"node\" is an alias for the latest version</span></pre></div>\n<p dir=\"auto\">To install a specific version of node:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"nvm install 14.7.0 # or 16.3.0, 12.22.1, etc\"><pre class=\"notranslate\">nvm install 14.7.0 <span class=\"pl-c\"><span class=\"pl-c\">#</span> or 16.3.0, 12.22.1, etc</span></pre></div>\n<p dir=\"auto\">To set an alias:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"nvm alias my_alias v14.4.0\"><pre class=\"notranslate\">nvm <span class=\"pl-c1\">alias</span> my_alias v14.4.0</pre></div>\n<p dir=\"auto\">Make sure that your alias does not contain any spaces or slashes.</p>\n<p dir=\"auto\">The first version installed becomes the default. New shells will start with the default version of node (e.g., <code class=\"notranslate\">nvm alias default</code>).</p>\n<p dir=\"auto\">You can list available versions using <code class=\"notranslate\">ls-remote</code>:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"nvm ls-remote\"><pre class=\"notranslate\">nvm ls-remote</pre></div>\n<p dir=\"auto\">And then in any new shell just use the installed version:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"nvm use node\"><pre class=\"notranslate\">nvm use node</pre></div>\n<p dir=\"auto\">Or you can just run it:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"nvm run node --version\"><pre class=\"notranslate\">nvm run node --version</pre></div>\n<p dir=\"auto\">Or, you can run any arbitrary command in a subshell with the desired version of node:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"nvm exec 4.2 node --version\"><pre class=\"notranslate\">nvm <span class=\"pl-c1\">exec</span> 4.2 node --version</pre></div>\n<p dir=\"auto\">You can also get the path to the executable to where it was installed:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"nvm which 12.22\"><pre class=\"notranslate\">nvm which 12.22</pre></div>\n<p dir=\"auto\">In place of a version pointer like \"14.7\" or \"16.3\" or \"12.22.1\", you can use the following special default aliases with <code class=\"notranslate\">nvm install</code>, <code class=\"notranslate\">nvm use</code>, <code class=\"notranslate\">nvm run</code>, <code class=\"notranslate\">nvm exec</code>, <code class=\"notranslate\">nvm which</code>, etc:</p>\n<ul dir=\"auto\">\n<li><code class=\"notranslate\">node</code>: this installs the latest version of <a href=\"https://nodejs.org/en/\" rel=\"nofollow\"><code class=\"notranslate\">node</code></a></li>\n<li><code class=\"notranslate\">iojs</code>: this installs the latest version of <a href=\"https://iojs.org/en/\" rel=\"nofollow\"><code class=\"notranslate\">io.js</code></a></li>\n<li><code class=\"notranslate\">stable</code>: this alias is deprecated, and only truly applies to <code class=\"notranslate\">node</code> <code class=\"notranslate\">v0.12</code> and earlier. Currently, this is an alias for <code class=\"notranslate\">node</code>.</li>\n<li><code class=\"notranslate\">unstable</code>: this alias points to <code class=\"notranslate\">node</code> <code class=\"notranslate\">v0.11</code> - the last \"unstable\" node release, since post-1.0, all node versions are stable. (in SemVer, versions communicate breakage, not stability).</li>\n</ul>\n<h3 dir=\"auto\">Long-term Support</h3>\n<p dir=\"auto\">Node has a <a href=\"https://github.com/nodejs/Release#release-schedule\">schedule</a> for long-term support (LTS) You can reference LTS versions in aliases and <code class=\"notranslate\">.nvmrc</code> files with the notation <code class=\"notranslate\">lts/*</code> for the latest LTS, and <code class=\"notranslate\">lts/argon</code> for LTS releases from the \"argon\" line, for example. In addition, the following commands support LTS arguments:</p>\n<ul dir=\"auto\">\n<li><code class=\"notranslate\">nvm install --lts</code> / <code class=\"notranslate\">nvm install --lts=argon</code> / <code class=\"notranslate\">nvm install 'lts/*'</code> / <code class=\"notranslate\">nvm install lts/argon</code></li>\n<li><code class=\"notranslate\">nvm uninstall --lts</code> / <code class=\"notranslate\">nvm uninstall --lts=argon</code> / <code class=\"notranslate\">nvm uninstall 'lts/*'</code> / <code class=\"notranslate\">nvm uninstall lts/argon</code></li>\n<li><code class=\"notranslate\">nvm use --lts</code> / <code class=\"notranslate\">nvm use --lts=argon</code> / <code class=\"notranslate\">nvm use 'lts/*'</code> / <code class=\"notranslate\">nvm use lts/argon</code></li>\n<li><code class=\"notranslate\">nvm exec --lts</code> / <code class=\"notranslate\">nvm exec --lts=argon</code> / <code class=\"notranslate\">nvm exec 'lts/*'</code> / <code class=\"notranslate\">nvm exec lts/argon</code></li>\n<li><code class=\"notranslate\">nvm run --lts</code> / <code class=\"notranslate\">nvm run --lts=argon</code> / <code class=\"notranslate\">nvm run 'lts/*'</code> / <code class=\"notranslate\">nvm run lts/argon</code></li>\n<li><code class=\"notranslate\">nvm ls-remote --lts</code> / <code class=\"notranslate\">nvm ls-remote --lts=argon</code> <code class=\"notranslate\">nvm ls-remote 'lts/*'</code> / <code class=\"notranslate\">nvm ls-remote lts/argon</code></li>\n<li><code class=\"notranslate\">nvm version-remote --lts</code> / <code class=\"notranslate\">nvm version-remote --lts=argon</code> / <code class=\"notranslate\">nvm version-remote 'lts/*'</code> / <code class=\"notranslate\">nvm version-remote lts/argon</code></li>\n</ul>\n<p dir=\"auto\">Any time your local copy of <code class=\"notranslate\">nvm</code> connects to <a href=\"https://nodejs.org\" rel=\"nofollow\">https://nodejs.org</a>, it will re-create the appropriate local aliases for all available LTS lines. These aliases (stored under <code class=\"notranslate\">$NVM_DIR/alias/lts</code>), are managed by <code class=\"notranslate\">nvm</code>, and you should not modify, remove, or create these files - expect your changes to be undone, and expect meddling with these files to cause bugs that will likely not be supported.</p>\n<p dir=\"auto\">To get the latest LTS version of node and migrate your existing installed packages, use</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"nvm install --reinstall-packages-from=current 'lts/*'\"><pre class=\"notranslate\">nvm install --reinstall-packages-from=current <span class=\"pl-s\"><span class=\"pl-pds\">'</span>lts/*<span class=\"pl-pds\">'</span></span></pre></div>\n<h3 dir=\"auto\">Migrating Global Packages While Installing</h3>\n<p dir=\"auto\">If you want to install a new version of Node.js and migrate npm packages from a previous version:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"nvm install --reinstall-packages-from=node node\"><pre class=\"notranslate\">nvm install --reinstall-packages-from=node node</pre></div>\n<p dir=\"auto\">This will first use \"nvm version node\" to identify the current version you're migrating packages from. Then it resolves the new version to install from the remote server and installs it. Lastly, it runs \"nvm reinstall-packages\" to reinstall the npm packages from your prior version of Node to the new one.</p>\n<p dir=\"auto\">You can also install and migrate npm packages from specific versions of Node like this:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"nvm install --reinstall-packages-from=5 6\nnvm install --reinstall-packages-from=iojs v4.2\"><pre class=\"notranslate\">nvm install --reinstall-packages-from=5 6\nnvm install --reinstall-packages-from=iojs v4.2</pre></div>\n<p dir=\"auto\">Note that reinstalling packages <em>explicitly does not update the npm version</em> — this is to ensure that npm isn't accidentally upgraded to a broken version for the new node version.</p>\n<p dir=\"auto\">To update npm at the same time add the <code class=\"notranslate\">--latest-npm</code> flag, like this:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"nvm install --reinstall-packages-from=default --latest-npm 'lts/*'\"><pre class=\"notranslate\">nvm install --reinstall-packages-from=default --latest-npm <span class=\"pl-s\"><span class=\"pl-pds\">'</span>lts/*<span class=\"pl-pds\">'</span></span></pre></div>\n<p dir=\"auto\">or, you can at any time run the following command to get the latest supported npm version on the current node version:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"nvm install-latest-npm\"><pre class=\"notranslate\">nvm install-latest-npm</pre></div>\n<p dir=\"auto\">If you've already gotten an error to the effect of \"npm does not support Node.js\", you'll need to (1) revert to a previous node version (<code class=\"notranslate\">nvm ls</code> &amp; <code class=\"notranslate\">nvm use &lt;your latest _working_ version from the ls&gt;</code>), (2) delete the newly created node version (<code class=\"notranslate\">nvm uninstall &lt;your _broken_ version of node from the ls&gt;</code>), then (3) rerun your <code class=\"notranslate\">nvm install</code> with the <code class=\"notranslate\">--latest-npm</code> flag.</p>\n<h3 dir=\"auto\">Default Global Packages From File While Installing</h3>\n<p dir=\"auto\">If you have a list of default packages you want installed every time you install a new version, we support that too -- just add the package names, one per line, to the file <code class=\"notranslate\">$NVM_DIR/default-packages</code>. You can add anything npm would accept as a package argument on the command line.</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"# $NVM_DIR/default-packages\n\nrimraf\nobject-inspect@1.0.2\nstevemao/left-pad\"><pre class=\"notranslate\"><span class=\"pl-c\"><span class=\"pl-c\">#</span> $NVM_DIR/default-packages</span>\n\nrimraf\nobject-inspect@1.0.2\nstevemao/left-pad</pre></div>\n<h3 dir=\"auto\">io.js</h3>\n<p dir=\"auto\">If you want to install <a href=\"https://github.com/iojs/io.js/\">io.js</a>:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"nvm install iojs\"><pre class=\"notranslate\">nvm install iojs</pre></div>\n<p dir=\"auto\">If you want to install a new version of io.js and migrate npm packages from a previous version:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"nvm install --reinstall-packages-from=iojs iojs\"><pre class=\"notranslate\">nvm install --reinstall-packages-from=iojs iojs</pre></div>\n<p dir=\"auto\">The same guidelines mentioned for migrating npm packages in node are applicable to io.js.</p>\n<h3 dir=\"auto\">System Version of Node</h3>\n<p dir=\"auto\">If you want to use the system-installed version of node, you can use the special default alias \"system\":</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"nvm use system\nnvm run system --version\"><pre class=\"notranslate\">nvm use system\nnvm run system --version</pre></div>\n<h3 dir=\"auto\">Listing Versions</h3>\n<p dir=\"auto\">If you want to see what versions are installed:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"nvm ls\"><pre class=\"notranslate\">nvm ls</pre></div>\n<p dir=\"auto\">If you want to see what versions are available to install:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"nvm ls-remote\"><pre class=\"notranslate\">nvm ls-remote</pre></div>\n<h3 dir=\"auto\">Setting Custom Colors</h3>\n<p dir=\"auto\">You can set five colors that will be used to display version and alias information. These colors replace the default colors.<br>\nInitial colors are: g b y r e</p>\n<p dir=\"auto\">Color codes:</p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"r/R = red / bold red\n\ng/G = green / bold green\n\nb/B = blue / bold blue\n\nc/C = cyan / bold cyan\n\nm/M = magenta / bold magenta\n\ny/Y = yellow / bold yellow\n\nk/K = black / bold black\n\ne/W = light grey / white\"><pre class=\"notranslate\"><code class=\"notranslate\">r/R = red / bold red\n\ng/G = green / bold green\n\nb/B = blue / bold blue\n\nc/C = cyan / bold cyan\n\nm/M = magenta / bold magenta\n\ny/Y = yellow / bold yellow\n\nk/K = black / bold black\n\ne/W = light grey / white\n</code></pre></div>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"nvm set-colors rgBcm\"><pre class=\"notranslate\">nvm set-colors rgBcm</pre></div>\n<h4 dir=\"auto\">Persisting custom colors</h4>\n<p dir=\"auto\">If you want the custom colors to persist after terminating the shell, export the <code class=\"notranslate\">NVM_COLORS</code> variable in your shell profile. For example, if you want to use cyan, magenta, green, bold red and bold yellow, add the following line:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"export NVM_COLORS='cmgRY'\"><pre class=\"notranslate\"><span class=\"pl-k\">export</span> NVM_COLORS=<span class=\"pl-s\"><span class=\"pl-pds\">'</span>cmgRY<span class=\"pl-pds\">'</span></span></pre></div>\n<h4 dir=\"auto\">Suppressing colorized output</h4>\n<p dir=\"auto\"><code class=\"notranslate\">nvm help (or -h or --help)</code>, <code class=\"notranslate\">nvm ls</code>, <code class=\"notranslate\">nvm ls-remote</code> and <code class=\"notranslate\">nvm alias</code> usually produce colorized output. You can disable colors with the <code class=\"notranslate\">--no-colors</code> option (or by setting the environment variable <code class=\"notranslate\">TERM=dumb</code>):</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"nvm ls --no-colors\nnvm help --no-colors\nTERM=dumb nvm ls\"><pre class=\"notranslate\">nvm ls --no-colors\nnvm <span class=\"pl-c1\">help</span> --no-colors\nTERM=dumb nvm ls</pre></div>\n<h3 dir=\"auto\">Restoring PATH</h3>\n<p dir=\"auto\">To restore your PATH, you can deactivate it:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"nvm deactivate\"><pre class=\"notranslate\">nvm deactivate</pre></div>\n<h3 dir=\"auto\">Set default node version</h3>\n<p dir=\"auto\">To set a default Node version to be used in any new shell, use the alias 'default':</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"nvm alias default node # this refers to the latest installed version of node\nnvm alias default 18 # this refers to the latest installed v18.x version of node\nnvm alias default 18.12  # this refers to the latest installed v18.12.x version of node\"><pre class=\"notranslate\">nvm <span class=\"pl-c1\">alias</span> default node <span class=\"pl-c\"><span class=\"pl-c\">#</span> this refers to the latest installed version of node</span>\nnvm <span class=\"pl-c1\">alias</span> default 18 <span class=\"pl-c\"><span class=\"pl-c\">#</span> this refers to the latest installed v18.x version of node</span>\nnvm <span class=\"pl-c1\">alias</span> default 18.12  <span class=\"pl-c\"><span class=\"pl-c\">#</span> this refers to the latest installed v18.12.x version of node</span></pre></div>\n<h3 dir=\"auto\">Use a mirror of node binaries</h3>\n<p dir=\"auto\">To use a mirror of the node binaries, set <code class=\"notranslate\">$NVM_NODEJS_ORG_MIRROR</code>:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"export NVM_NODEJS_ORG_MIRROR=https://nodejs.org/dist\nnvm install node\n\nNVM_NODEJS_ORG_MIRROR=https://nodejs.org/dist nvm install 4.2\"><pre class=\"notranslate\"><span class=\"pl-k\">export</span> NVM_NODEJS_ORG_MIRROR=https://nodejs.org/dist\nnvm install node\n\nNVM_NODEJS_ORG_MIRROR=https://nodejs.org/dist nvm install 4.2</pre></div>\n<p dir=\"auto\">To use a mirror of the io.js binaries, set <code class=\"notranslate\">$NVM_IOJS_ORG_MIRROR</code>:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"export NVM_IOJS_ORG_MIRROR=https://iojs.org/dist\nnvm install iojs-v1.0.3\n\nNVM_IOJS_ORG_MIRROR=https://iojs.org/dist nvm install iojs-v1.0.3\"><pre class=\"notranslate\"><span class=\"pl-k\">export</span> NVM_IOJS_ORG_MIRROR=https://iojs.org/dist\nnvm install iojs-v1.0.3\n\nNVM_IOJS_ORG_MIRROR=https://iojs.org/dist nvm install iojs-v1.0.3</pre></div>\n<p dir=\"auto\"><code class=\"notranslate\">nvm use</code> will not, by default, create a \"current\" symlink. Set <code class=\"notranslate\">$NVM_SYMLINK_CURRENT</code> to \"true\" to enable this behavior, which is sometimes useful for IDEs. Note that using <code class=\"notranslate\">nvm</code> in multiple shell tabs with this environment variable enabled can cause race conditions.</p>\n<h4 dir=\"auto\">Pass Authorization header to mirror</h4>\n<p dir=\"auto\">To pass an Authorization header through to the mirror url, set <code class=\"notranslate\">$NVM_AUTH_HEADER</code></p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"NVM_AUTH_HEADER=&quot;Bearer secret-token&quot; nvm install node\"><pre class=\"notranslate\">NVM_AUTH_HEADER=<span class=\"pl-s\"><span class=\"pl-pds\">\"</span>Bearer secret-token<span class=\"pl-pds\">\"</span></span> nvm install node</pre></div>\n<h3 dir=\"auto\">.nvmrc</h3>\n<p dir=\"auto\">You can create a <code class=\"notranslate\">.nvmrc</code> file containing a node version number (or any other string that <code class=\"notranslate\">nvm</code> understands; see <code class=\"notranslate\">nvm --help</code> for details) in the project root directory (or any parent directory).<br>\nAfterwards, <code class=\"notranslate\">nvm use</code>, <code class=\"notranslate\">nvm install</code>, <code class=\"notranslate\">nvm exec</code>, <code class=\"notranslate\">nvm run</code>, and <code class=\"notranslate\">nvm which</code> will use the version specified in the <code class=\"notranslate\">.nvmrc</code> file if no version is supplied on the command line.</p>\n<p dir=\"auto\">For example, to make nvm default to the latest 5.9 release, the latest LTS version, or the latest node version for the current directory:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"$ echo &quot;5.9&quot; &gt; .nvmrc\n\n$ echo &quot;lts/*&quot; &gt; .nvmrc # to default to the latest LTS version\n\n$ echo &quot;node&quot; &gt; .nvmrc # to default to the latest version\"><pre class=\"notranslate\">$ <span class=\"pl-c1\">echo</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span>5.9<span class=\"pl-pds\">\"</span></span> <span class=\"pl-k\">&gt;</span> .nvmrc\n\n$ <span class=\"pl-c1\">echo</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span>lts/*<span class=\"pl-pds\">\"</span></span> <span class=\"pl-k\">&gt;</span> .nvmrc <span class=\"pl-c\"><span class=\"pl-c\">#</span> to default to the latest LTS version</span>\n\n$ <span class=\"pl-c1\">echo</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span>node<span class=\"pl-pds\">\"</span></span> <span class=\"pl-k\">&gt;</span> .nvmrc <span class=\"pl-c\"><span class=\"pl-c\">#</span> to default to the latest version</span></pre></div>\n<p dir=\"auto\">[NB these examples assume a POSIX-compliant shell version of <code class=\"notranslate\">echo</code>. If you use a Windows <code class=\"notranslate\">cmd</code> development environment, eg the <code class=\"notranslate\">.nvmrc</code> file is used to configure a remote Linux deployment, then keep in mind the <code class=\"notranslate\">\"</code>s will be copied leading to an invalid file. Remove them.]</p>\n<p dir=\"auto\">Then when you run nvm use:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"$ nvm use\nFound '/path/to/project/.nvmrc' with version &lt;5.9&gt;\nNow using node v5.9.1 (npm v3.7.3)\"><pre class=\"notranslate\">$ nvm use\nFound <span class=\"pl-s\"><span class=\"pl-pds\">'</span>/path/to/project/.nvmrc<span class=\"pl-pds\">'</span></span> with version <span class=\"pl-k\">&lt;</span>5.<span class=\"pl-k\">9&gt;</span>\nNow using node v5.9.1 (npm v3.7.3)</pre></div>\n<p dir=\"auto\">Running nvm install will also switch over to the correct version, but if the correct node version isn't already installed, it will install it for you.</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"$ nvm install\nFound '/path/to/project/.nvmrc' with version &lt;5.9&gt;\nDownloading and installing node v5.9.1...\nDownloading https://nodejs.org/dist/v5.9.1/node-v5.9.1-linux-x64.tar.xz...\n#################################################################################### 100.0%\nComputing checksum with sha256sum\nChecksums matched!\nNow using node v5.9.1 (npm v3.7.3)\"><pre class=\"notranslate\">$ nvm install\nFound <span class=\"pl-s\"><span class=\"pl-pds\">'</span>/path/to/project/.nvmrc<span class=\"pl-pds\">'</span></span> with version <span class=\"pl-k\">&lt;</span>5.<span class=\"pl-k\">9&gt;</span>\nDownloading and installing node v5.9.1...\nDownloading https://nodejs.org/dist/v5.9.1/node-v5.9.1-linux-x64.tar.xz...\n<span class=\"pl-c\"><span class=\"pl-c\">#</span>################################################################################### 100.0%</span>\nComputing checksum with sha256sum\nChecksums matched<span class=\"pl-k\">!</span>\nNow using node v5.9.1 (npm v3.7.3)</pre></div>\n<p dir=\"auto\"><code class=\"notranslate\">nvm use</code> et. al. will traverse directory structure upwards from the current directory looking for the <code class=\"notranslate\">.nvmrc</code> file. In other words, running <code class=\"notranslate\">nvm use</code> et. al. in any subdirectory of a directory with an <code class=\"notranslate\">.nvmrc</code> will result in that <code class=\"notranslate\">.nvmrc</code> being utilized.</p>\n<p dir=\"auto\">The contents of a <code class=\"notranslate\">.nvmrc</code> file <strong>must</strong> contain precisely one <code class=\"notranslate\">&lt;version&gt;</code> (as described by <code class=\"notranslate\">nvm --help</code>) followed by a newline. <code class=\"notranslate\">.nvmrc</code> files may also have comments. The comment delimiter is <code class=\"notranslate\">#</code>, and it and any text after it, as well as blank lines, and leading and trailing white space, will be ignored when parsing.</p>\n<p dir=\"auto\">Key/value pairs using <code class=\"notranslate\">=</code> are also allowed and ignored, but are reserved for future use, and may cause validation errors in the future.</p>\n<p dir=\"auto\">Run <a href=\"https://npmjs.com/nvmrc\" rel=\"nofollow\"><code class=\"notranslate\">npx nvmrc</code></a> to validate an <code class=\"notranslate\">.nvmrc</code> file. If that tool’s results do not agree with nvm, one or the other has a bug - please file an issue.</p>\n<h3 dir=\"auto\">Deeper Shell Integration</h3>\n<p dir=\"auto\">You can use <a href=\"https://github.com/iamogbz/nvshim\"><code class=\"notranslate\">nvshim</code></a> to shim the <code class=\"notranslate\">node</code>, <code class=\"notranslate\">npm</code>, and <code class=\"notranslate\">npx</code> bins to automatically use the <code class=\"notranslate\">nvm</code> config in the current directory. <code class=\"notranslate\">nvshim</code> is <strong>not</strong> supported by the <code class=\"notranslate\">nvm</code> maintainers. Please <a href=\"https://github.com/iamogbz/nvshim/issues/new\">report issues to the <code class=\"notranslate\">nvshim</code> team</a>.</p>\n<p dir=\"auto\">If you prefer a lighter-weight solution, the recipes below have been contributed by <code class=\"notranslate\">nvm</code> users. They are <strong>not</strong> supported by the <code class=\"notranslate\">nvm</code> maintainers. We are, however, accepting pull requests for more examples.</p>\n<h4 dir=\"auto\">Calling <code class=\"notranslate\">nvm use</code> automatically in a directory with a <code class=\"notranslate\">.nvmrc</code> file</h4>\n<p dir=\"auto\">In your profile (<code class=\"notranslate\">~/.bash_profile</code>, <code class=\"notranslate\">~/.zshrc</code>, <code class=\"notranslate\">~/.profile</code>, or <code class=\"notranslate\">~/.bashrc</code>), add the following to <code class=\"notranslate\">nvm use</code> whenever you enter a new directory:</p>\n<h5 dir=\"auto\">bash</h5>\n<p dir=\"auto\">Put the following at the end of your <code class=\"notranslate\">$HOME/.bashrc</code>:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"cdnvm() {\n    command cd &quot;$@&quot; || return $?\n    nvm_path=&quot;$(nvm_find_up .nvmrc | command tr -d '\\n')&quot;\n\n    # If there are no .nvmrc file, use the default nvm version\n    if [[ ! $nvm_path = *[^[:space:]]* ]]; then\n\n        declare default_version\n        default_version=&quot;$(nvm version default)&quot;\n\n        # If there is no default version, set it to `node`\n        # This will use the latest version on your machine\n        if [ $default_version = 'N/A' ]; then\n            nvm alias default node\n            default_version=$(nvm version default)\n        fi\n\n        # If the current version is not the default version, set it to use the default version\n        if [ &quot;$(nvm current)&quot; != &quot;${default_version}&quot; ]; then\n            nvm use default\n        fi\n    elif [[ -s &quot;${nvm_path}/.nvmrc&quot; &amp;&amp; -r &quot;${nvm_path}/.nvmrc&quot; ]]; then\n        declare nvm_version\n        nvm_version=$(&lt;&quot;${nvm_path}&quot;/.nvmrc)\n\n        declare locally_resolved_nvm_version\n        # `nvm ls` will check all locally-available versions\n        # If there are multiple matching versions, take the latest one\n        # Remove the `-&gt;` and `*` characters and spaces\n        # `locally_resolved_nvm_version` will be `N/A` if no local versions are found\n        locally_resolved_nvm_version=$(nvm ls --no-colors &quot;${nvm_version}&quot; | command tail -1 | command tr -d '\\-&gt;*' | command tr -d '[:space:]')\n\n        # If it is not already installed, install it\n        # `nvm install` will implicitly use the newly-installed version\n        if [ &quot;${locally_resolved_nvm_version}&quot; = 'N/A' ]; then\n            nvm install &quot;${nvm_version}&quot;;\n        elif [ &quot;$(nvm current)&quot; != &quot;${locally_resolved_nvm_version}&quot; ]; then\n            nvm use &quot;${nvm_version}&quot;;\n        fi\n    fi\n}\n\nalias cd='cdnvm'\ncdnvm &quot;$PWD&quot; || exit\"><pre class=\"notranslate\"><span class=\"pl-en\">cdnvm</span>() {\n    <span class=\"pl-c1\">command</span> <span class=\"pl-c1\">cd</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">$@</span><span class=\"pl-pds\">\"</span></span> <span class=\"pl-k\">||</span> <span class=\"pl-k\">return</span> <span class=\"pl-smi\">$?</span>\n    nvm_path=<span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-s\"><span class=\"pl-pds\">$(</span>nvm_find_up .nvmrc <span class=\"pl-k\">|</span> <span class=\"pl-c1\">command</span> tr -d <span class=\"pl-s\"><span class=\"pl-pds\">'</span>\\n<span class=\"pl-pds\">'</span></span><span class=\"pl-pds\">)</span></span><span class=\"pl-pds\">\"</span></span>\n\n    <span class=\"pl-c\"><span class=\"pl-c\">#</span> If there are no .nvmrc file, use the default nvm version</span>\n    <span class=\"pl-k\">if</span> [[ <span class=\"pl-k\">!</span> <span class=\"pl-smi\">$nvm_path</span> <span class=\"pl-k\">=</span> <span class=\"pl-k\">*</span>[^[:space:]]<span class=\"pl-k\">*</span> ]]<span class=\"pl-k\">;</span> <span class=\"pl-k\">then</span>\n\n        <span class=\"pl-k\">declare</span> default_version\n        default_version<span class=\"pl-k\">=</span><span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-s\"><span class=\"pl-pds\">$(</span>nvm version default<span class=\"pl-pds\">)</span></span><span class=\"pl-pds\">\"</span></span>\n\n        <span class=\"pl-c\"><span class=\"pl-c\">#</span> If there is no default version, set it to `node`</span>\n        <span class=\"pl-c\"><span class=\"pl-c\">#</span> This will use the latest version on your machine</span>\n        <span class=\"pl-k\">if</span> [ <span class=\"pl-smi\">$default_version</span> <span class=\"pl-k\">=</span> <span class=\"pl-s\"><span class=\"pl-pds\">'</span>N/A<span class=\"pl-pds\">'</span></span> ]<span class=\"pl-k\">;</span> <span class=\"pl-k\">then</span>\n            nvm <span class=\"pl-c1\">alias</span> default node\n            default_version=<span class=\"pl-s\"><span class=\"pl-pds\">$(</span>nvm version default<span class=\"pl-pds\">)</span></span>\n        <span class=\"pl-k\">fi</span>\n\n        <span class=\"pl-c\"><span class=\"pl-c\">#</span> If the current version is not the default version, set it to use the default version</span>\n        <span class=\"pl-k\">if</span> [ <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-s\"><span class=\"pl-pds\">$(</span>nvm current<span class=\"pl-pds\">)</span></span><span class=\"pl-pds\">\"</span></span> <span class=\"pl-k\">!=</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">${default_version}</span><span class=\"pl-pds\">\"</span></span> ]<span class=\"pl-k\">;</span> <span class=\"pl-k\">then</span>\n            nvm use default\n        <span class=\"pl-k\">fi</span>\n    <span class=\"pl-k\">elif</span> [[ <span class=\"pl-k\">-s</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">${nvm_path}</span>/.nvmrc<span class=\"pl-pds\">\"</span></span> <span class=\"pl-k\">&amp;&amp;</span> <span class=\"pl-k\">-r</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">${nvm_path}</span>/.nvmrc<span class=\"pl-pds\">\"</span></span> ]]<span class=\"pl-k\">;</span> <span class=\"pl-k\">then</span>\n        <span class=\"pl-k\">declare</span> nvm_version\n        nvm_version<span class=\"pl-k\">=</span><span class=\"pl-s\"><span class=\"pl-pds\">$(</span><span class=\"pl-k\">&lt;</span><span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">${nvm_path}</span><span class=\"pl-pds\">\"</span></span>/.nvmrc<span class=\"pl-pds\">)</span></span>\n\n        <span class=\"pl-k\">declare</span> locally_resolved_nvm_version\n        <span class=\"pl-c\"><span class=\"pl-c\">#</span> `nvm ls` will check all locally-available versions</span>\n        <span class=\"pl-c\"><span class=\"pl-c\">#</span> If there are multiple matching versions, take the latest one</span>\n        <span class=\"pl-c\"><span class=\"pl-c\">#</span> Remove the `-&gt;` and `*` characters and spaces</span>\n        <span class=\"pl-c\"><span class=\"pl-c\">#</span> `locally_resolved_nvm_version` will be `N/A` if no local versions are found</span>\n        locally_resolved_nvm_version<span class=\"pl-k\">=</span><span class=\"pl-s\"><span class=\"pl-pds\">$(</span>nvm ls --no-colors <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">${nvm_version}</span><span class=\"pl-pds\">\"</span></span> <span class=\"pl-k\">|</span> <span class=\"pl-c1\">command</span> tail -1 <span class=\"pl-k\">|</span> <span class=\"pl-c1\">command</span> tr -d <span class=\"pl-s\"><span class=\"pl-pds\">'</span>\\-&gt;*<span class=\"pl-pds\">'</span></span> <span class=\"pl-k\">|</span> <span class=\"pl-c1\">command</span> tr -d <span class=\"pl-s\"><span class=\"pl-pds\">'</span>[:space:]<span class=\"pl-pds\">'</span></span><span class=\"pl-pds\">)</span></span>\n\n        <span class=\"pl-c\"><span class=\"pl-c\">#</span> If it is not already installed, install it</span>\n        <span class=\"pl-c\"><span class=\"pl-c\">#</span> `nvm install` will implicitly use the newly-installed version</span>\n        <span class=\"pl-k\">if</span> [ <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">${locally_resolved_nvm_version}</span><span class=\"pl-pds\">\"</span></span> <span class=\"pl-k\">=</span> <span class=\"pl-s\"><span class=\"pl-pds\">'</span>N/A<span class=\"pl-pds\">'</span></span> ]<span class=\"pl-k\">;</span> <span class=\"pl-k\">then</span>\n            nvm install <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">${nvm_version}</span><span class=\"pl-pds\">\"</span></span><span class=\"pl-k\">;</span>\n        <span class=\"pl-k\">elif</span> [ <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-s\"><span class=\"pl-pds\">$(</span>nvm current<span class=\"pl-pds\">)</span></span><span class=\"pl-pds\">\"</span></span> <span class=\"pl-k\">!=</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">${locally_resolved_nvm_version}</span><span class=\"pl-pds\">\"</span></span> ]<span class=\"pl-k\">;</span> <span class=\"pl-k\">then</span>\n            nvm use <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">${nvm_version}</span><span class=\"pl-pds\">\"</span></span><span class=\"pl-k\">;</span>\n        <span class=\"pl-k\">fi</span>\n    <span class=\"pl-k\">fi</span>\n}\n\n<span class=\"pl-c1\">alias</span> cd<span class=\"pl-k\">=</span><span class=\"pl-s\"><span class=\"pl-pds\">'</span>cdnvm<span class=\"pl-pds\">'</span></span>\ncdnvm <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">$PWD</span><span class=\"pl-pds\">\"</span></span> <span class=\"pl-k\">||</span> <span class=\"pl-c1\">exit</span></pre></div>\n<p dir=\"auto\">This alias would search 'up' from your current directory in order to detect a <code class=\"notranslate\">.nvmrc</code> file. If it finds it, it will switch to that version; if not, it will use the default version.</p>\n<h5 dir=\"auto\">zsh</h5>\n<p dir=\"auto\">This shell function will install (if needed) and <code class=\"notranslate\">nvm use</code> the specified Node version when an <code class=\"notranslate\">.nvmrc</code> is found, and <code class=\"notranslate\">nvm use default</code> otherwise.</p>\n<p dir=\"auto\">Put this into your <code class=\"notranslate\">$HOME/.zshrc</code> to call <code class=\"notranslate\">nvm use</code> automatically whenever you enter a directory that contains an<br>\n<code class=\"notranslate\">.nvmrc</code> file with a string telling nvm which node to <code class=\"notranslate\">use</code>:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"# place this after nvm initialization!\nautoload -U add-zsh-hook\n\nload-nvmrc() {\n  local nvmrc_path\n  nvmrc_path=&quot;$(nvm_find_nvmrc)&quot;\n\n  if [ -n &quot;$nvmrc_path&quot; ]; then\n    local nvmrc_node_version\n    nvmrc_node_version=$(nvm version &quot;$(cat &quot;${nvmrc_path}&quot;)&quot;)\n\n    if [ &quot;$nvmrc_node_version&quot; = &quot;N/A&quot; ]; then\n      nvm install\n    elif [ &quot;$nvmrc_node_version&quot; != &quot;$(nvm version)&quot; ]; then\n      nvm use\n    fi\n  elif [ -n &quot;$(PWD=$OLDPWD nvm_find_nvmrc)&quot; ] &amp;&amp; [ &quot;$(nvm version)&quot; != &quot;$(nvm version default)&quot; ]; then\n    echo &quot;Reverting to nvm default version&quot;\n    nvm use default\n  fi\n}\n\nadd-zsh-hook chpwd load-nvmrc\nload-nvmrc\"><pre class=\"notranslate\"><span class=\"pl-c\"><span class=\"pl-c\">#</span> place this after nvm initialization!</span>\nautoload -U add-zsh-hook\n\n<span class=\"pl-en\">load-nvmrc</span>() {\n  <span class=\"pl-k\">local</span> nvmrc_path\n  nvmrc_path=<span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-s\"><span class=\"pl-pds\">$(</span>nvm_find_nvmrc<span class=\"pl-pds\">)</span></span><span class=\"pl-pds\">\"</span></span>\n\n  <span class=\"pl-k\">if</span> [ <span class=\"pl-k\">-n</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">$nvmrc_path</span><span class=\"pl-pds\">\"</span></span> ]<span class=\"pl-k\">;</span> <span class=\"pl-k\">then</span>\n    <span class=\"pl-k\">local</span> nvmrc_node_version\n    nvmrc_node_version=<span class=\"pl-s\"><span class=\"pl-pds\">$(</span>nvm version <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-s\"><span class=\"pl-pds\">$(</span>cat <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">${nvmrc_path}</span><span class=\"pl-pds\">\"</span></span><span class=\"pl-pds\">)</span></span><span class=\"pl-pds\">\"</span></span><span class=\"pl-pds\">)</span></span>\n\n    <span class=\"pl-k\">if</span> [ <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">$nvmrc_node_version</span><span class=\"pl-pds\">\"</span></span> <span class=\"pl-k\">=</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span>N/A<span class=\"pl-pds\">\"</span></span> ]<span class=\"pl-k\">;</span> <span class=\"pl-k\">then</span>\n      nvm install\n    <span class=\"pl-k\">elif</span> [ <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">$nvmrc_node_version</span><span class=\"pl-pds\">\"</span></span> <span class=\"pl-k\">!=</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-s\"><span class=\"pl-pds\">$(</span>nvm version<span class=\"pl-pds\">)</span></span><span class=\"pl-pds\">\"</span></span> ]<span class=\"pl-k\">;</span> <span class=\"pl-k\">then</span>\n      nvm use\n    <span class=\"pl-k\">fi</span>\n  <span class=\"pl-k\">elif</span> [ <span class=\"pl-k\">-n</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-s\"><span class=\"pl-pds\">$(</span>PWD=<span class=\"pl-smi\">$OLDPWD</span> nvm_find_nvmrc<span class=\"pl-pds\">)</span></span><span class=\"pl-pds\">\"</span></span> ] <span class=\"pl-k\">&amp;&amp;</span> [ <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-s\"><span class=\"pl-pds\">$(</span>nvm version<span class=\"pl-pds\">)</span></span><span class=\"pl-pds\">\"</span></span> <span class=\"pl-k\">!=</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-s\"><span class=\"pl-pds\">$(</span>nvm version default<span class=\"pl-pds\">)</span></span><span class=\"pl-pds\">\"</span></span> ]<span class=\"pl-k\">;</span> <span class=\"pl-k\">then</span>\n    <span class=\"pl-c1\">echo</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span>Reverting to nvm default version<span class=\"pl-pds\">\"</span></span>\n    nvm use default\n  <span class=\"pl-k\">fi</span>\n}\n\nadd-zsh-hook chpwd load-nvmrc\nload-nvmrc</pre></div>\n<p dir=\"auto\">After saving the file, run <code class=\"notranslate\">source ~/.zshrc</code> to reload the configuration with the latest changes made.</p>\n<h5 dir=\"auto\">fish</h5>\n<p dir=\"auto\">This requires that you have <a href=\"https://github.com/edc/bass\">bass</a> installed.</p>\n<div class=\"highlight highlight-source-fish notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"# ~/.config/fish/functions/nvm.fish\nfunction nvm\n  bass source ~/.nvm/nvm.sh --no-use ';' nvm $argv\nend\n\n# ~/.config/fish/functions/nvm_find_nvmrc.fish\nfunction nvm_find_nvmrc\n  bass source ~/.nvm/nvm.sh --no-use ';' nvm_find_nvmrc\nend\n\n# ~/.config/fish/functions/load_nvm.fish\nfunction load_nvm --on-variable=&quot;PWD&quot;\n  set -l default_node_version (nvm version default)\n  set -l node_version (nvm version)\n  set -l nvmrc_path (nvm_find_nvmrc)\n  if test -n &quot;$nvmrc_path&quot;\n    set -l nvmrc_node_version (nvm version (cat $nvmrc_path))\n    if test &quot;$nvmrc_node_version&quot; = &quot;N/A&quot;\n      nvm install (cat $nvmrc_path)\n    else if test &quot;$nvmrc_node_version&quot; != &quot;$node_version&quot;\n      nvm use $nvmrc_node_version\n    end\n  else if test &quot;$node_version&quot; != &quot;$default_node_version&quot;\n    echo &quot;Reverting to default Node version&quot;\n    nvm use default\n  end\nend\n\n# ~/.config/fish/config.fish\n# You must call it on initialization or listening to directory switching won't work\nload_nvm &gt; /dev/stderr\"><pre class=\"notranslate\"><span class=\"pl-c\"><span class=\"pl-c\">#</span> ~/.config/fish/functions/nvm.fish</span>\n<span class=\"pl-k\">function</span> nvm\n  bass source ~/.nvm/nvm.<span class=\"pl-c1\">sh</span> <span class=\"pl-s\">--no-use</span> <span class=\"pl-s\"><span class=\"pl-pds\">'</span>;<span class=\"pl-pds\">'</span></span> nvm <span class=\"pl-smi\">$argv</span>\n<span class=\"pl-k\">end</span>\n\n<span class=\"pl-c\"><span class=\"pl-c\">#</span> ~/.config/fish/functions/nvm_find_nvmrc.fish</span>\n<span class=\"pl-k\">function</span> nvm_find_nvmrc\n  bass source ~/.nvm/nvm.<span class=\"pl-c1\">sh</span> <span class=\"pl-s\">--no-use</span> <span class=\"pl-s\"><span class=\"pl-pds\">'</span>;<span class=\"pl-pds\">'</span></span> nvm_find_nvmrc\n<span class=\"pl-k\">end</span>\n\n<span class=\"pl-c\"><span class=\"pl-c\">#</span> ~/.config/fish/functions/load_nvm.fish</span>\n<span class=\"pl-k\">function</span> load_nvm <span class=\"pl-s\">--on-variable</span>=<span class=\"pl-s\"><span class=\"pl-pds\">\"</span>PWD<span class=\"pl-pds\">\"</span></span>\n  <span class=\"pl-c1\">set</span> <span class=\"pl-s\">-l</span> default_node_version (nvm version default)\n  <span class=\"pl-c1\">set</span> <span class=\"pl-s\">-l</span> node_version (nvm version)\n  <span class=\"pl-c1\">set</span> <span class=\"pl-s\">-l</span> nvmrc_path (nvm_find_nvmrc)\n  <span class=\"pl-k\">if</span> <span class=\"pl-c1\">test</span> <span class=\"pl-s\">-n</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">$nvmrc_path</span><span class=\"pl-pds\">\"</span></span>\n    <span class=\"pl-c1\">set</span> <span class=\"pl-s\">-l</span> nvmrc_node_version (nvm version (<span class=\"pl-c1\">cat</span> <span class=\"pl-smi\">$nvmrc_path</span>))\n    <span class=\"pl-k\">if</span> <span class=\"pl-c1\">test</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">$nvmrc_node_version</span><span class=\"pl-pds\">\"</span></span> = <span class=\"pl-s\"><span class=\"pl-pds\">\"</span>N/A<span class=\"pl-pds\">\"</span></span>\n      nvm install (<span class=\"pl-c1\">cat</span> <span class=\"pl-smi\">$nvmrc_path</span>)\n    <span class=\"pl-k\">else</span> <span class=\"pl-k\">if</span> <span class=\"pl-c1\">test</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">$nvmrc_node_version</span><span class=\"pl-pds\">\"</span></span> != <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">$node_version</span><span class=\"pl-pds\">\"</span></span>\n      nvm use <span class=\"pl-smi\">$nvmrc_node_version</span>\n    <span class=\"pl-k\">end</span>\n  <span class=\"pl-k\">else</span> <span class=\"pl-k\">if</span> <span class=\"pl-c1\">test</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">$node_version</span><span class=\"pl-pds\">\"</span></span> != <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">$default_node_version</span><span class=\"pl-pds\">\"</span></span>\n    <span class=\"pl-c1\">echo</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span>Reverting to default Node version<span class=\"pl-pds\">\"</span></span>\n    nvm use default\n  <span class=\"pl-k\">end</span>\n<span class=\"pl-k\">end</span>\n\n<span class=\"pl-c\"><span class=\"pl-c\">#</span> ~/.config/fish/config.fish</span>\n<span class=\"pl-c\"><span class=\"pl-c\">#</span> You must call it on initialization or listening to directory switching won't work</span>\nload_nvm <span class=\"pl-k\">&gt;</span> /dev/stderr</pre></div>\n<h2 dir=\"auto\">Running Tests</h2>\n<p dir=\"auto\">Tests are written in <a href=\"https://git.sdf.org/tlevine/urchin\" rel=\"nofollow\">Urchin</a>. Install Urchin (and other dependencies) like so:</p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"npm install\"><pre class=\"notranslate\"><code class=\"notranslate\">npm install\n</code></pre></div>\n<p dir=\"auto\">There are slow tests and fast tests. The slow tests do things like install node<br>\nand check that the right versions are used. The fast tests fake this to test<br>\nthings like aliases and uninstalling. From the root of the nvm git repository,<br>\nrun the fast tests like this:</p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"npm run test/fast\"><pre class=\"notranslate\"><code class=\"notranslate\">npm run test/fast\n</code></pre></div>\n<p dir=\"auto\">Run the slow tests like this:</p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"npm run test/slow\"><pre class=\"notranslate\"><code class=\"notranslate\">npm run test/slow\n</code></pre></div>\n<p dir=\"auto\">Run all of the tests like this:</p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"npm test\"><pre class=\"notranslate\"><code class=\"notranslate\">npm test\n</code></pre></div>\n<p dir=\"auto\">Nota bene: Avoid running nvm while the tests are running.</p>\n<h2 dir=\"auto\">Environment variables</h2>\n<p dir=\"auto\">nvm exposes the following environment variables:</p>\n<ul dir=\"auto\">\n<li><code class=\"notranslate\">NVM_DIR</code> - nvm's installation directory.</li>\n<li><code class=\"notranslate\">NVM_BIN</code> - where node, npm, and global packages for the active version of node are installed.</li>\n<li><code class=\"notranslate\">NVM_INC</code> - node's include file directory (useful for building C/C++ addons for node).</li>\n<li><code class=\"notranslate\">NVM_CD_FLAGS</code> - used to maintain compatibility with zsh.</li>\n<li><code class=\"notranslate\">NVM_RC_VERSION</code> - version from .nvmrc file if being used.</li>\n</ul>\n<p dir=\"auto\">Additionally, nvm modifies <code class=\"notranslate\">PATH</code>, and, if present, <code class=\"notranslate\">MANPATH</code> and <code class=\"notranslate\">NODE_PATH</code> when changing versions.</p>\n<h2 dir=\"auto\">Bash Completion</h2>\n<p dir=\"auto\">To activate, you need to source <code class=\"notranslate\">bash_completion</code>:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"[[ -r $NVM_DIR/bash_completion ]] &amp;&amp; \\. $NVM_DIR/bash_completion\"><pre class=\"notranslate\">[[ <span class=\"pl-k\">-r</span> <span class=\"pl-smi\">$NVM_DIR</span>/bash_completion ]] <span class=\"pl-k\">&amp;&amp;</span> <span class=\"pl-cce\">\\.</span> <span class=\"pl-smi\">$NVM_DIR</span>/bash_completion</pre></div>\n<p dir=\"auto\">Put the above sourcing line just below the sourcing line for nvm in your profile (<code class=\"notranslate\">.bashrc</code>, <code class=\"notranslate\">.bash_profile</code>).</p>\n<h3 dir=\"auto\">Usage</h3>\n<p dir=\"auto\">nvm:</p>\n<blockquote>\n<p dir=\"auto\"><code class=\"notranslate\">$ nvm</code> <kbd>Tab</kbd></p>\n</blockquote>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"alias               deactivate          install             list-remote         reinstall-packages  uninstall           version\ncache               exec                install-latest-npm  ls                  run                 unload              version-remote\ncurrent             help                list                ls-remote           unalias             use                 which\"><pre class=\"notranslate\"><span class=\"pl-c1\">alias</span>               deactivate          install             list-remote         reinstall-packages  uninstall           version\ncache               <span class=\"pl-c1\">exec</span>                install-latest-npm  ls                  run                 unload              version-remote\ncurrent             <span class=\"pl-c1\">help</span>                list                ls-remote           <span class=\"pl-c1\">unalias</span>             use                 which</pre></div>\n<p dir=\"auto\">nvm alias:</p>\n<blockquote>\n<p dir=\"auto\"><code class=\"notranslate\">$ nvm alias</code> <kbd>Tab</kbd></p>\n</blockquote>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"default      iojs         lts/*        lts/argon    lts/boron    lts/carbon   lts/dubnium  lts/erbium   node         stable       unstable\"><pre class=\"notranslate\">default      iojs         lts/<span class=\"pl-k\">*</span>        lts/argon    lts/boron    lts/carbon   lts/dubnium  lts/erbium   node         stable       unstable</pre></div>\n<blockquote>\n<p dir=\"auto\"><code class=\"notranslate\">$ nvm alias my_alias</code> <kbd>Tab</kbd></p>\n</blockquote>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"v10.22.0       v12.18.3      v14.8.0\"><pre class=\"notranslate\">v10.22.0       v12.18.3      v14.8.0</pre></div>\n<p dir=\"auto\">nvm use:</p>\n<blockquote>\n<p dir=\"auto\"><code class=\"notranslate\">$ nvm use</code> <kbd>Tab</kbd></p>\n</blockquote>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"my_alias        default        v10.22.0       v12.18.3      v14.8.0\"><pre class=\"notranslate\"><code class=\"notranslate\">my_alias        default        v10.22.0       v12.18.3      v14.8.0\n</code></pre></div>\n<p dir=\"auto\">nvm uninstall:</p>\n<blockquote>\n<p dir=\"auto\"><code class=\"notranslate\">$ nvm uninstall</code> <kbd>Tab</kbd></p>\n</blockquote>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"my_alias        default        v10.22.0       v12.18.3      v14.8.0\"><pre class=\"notranslate\"><code class=\"notranslate\">my_alias        default        v10.22.0       v12.18.3      v14.8.0\n</code></pre></div>\n<h2 dir=\"auto\">Compatibility Issues</h2>\n<p dir=\"auto\"><code class=\"notranslate\">nvm</code> will encounter some issues if you have some non-default settings set. (see <a href=\"https://github.com/nvm-sh/nvm/issues/606\" data-hovercard-type=\"issue\" data-hovercard-url=\"/nvm-sh/nvm/issues/606/hovercard\">#606</a>)<br>\nThe following are known to cause issues:</p>\n<p dir=\"auto\">Inside <code class=\"notranslate\">~/.npmrc</code>:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"prefix='some/path'\"><pre class=\"notranslate\">prefix=<span class=\"pl-s\"><span class=\"pl-pds\">'</span>some/path<span class=\"pl-pds\">'</span></span></pre></div>\n<p dir=\"auto\">Environment Variables:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"$NPM_CONFIG_PREFIX\n$PREFIX\"><pre class=\"notranslate\"><span class=\"pl-smi\">$NPM_CONFIG_PREFIX</span>\n<span class=\"pl-smi\">$PREFIX</span></pre></div>\n<p dir=\"auto\">Shell settings:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"set -e\"><pre class=\"notranslate\"><span class=\"pl-c1\">set</span> -e</pre></div>\n<h2 dir=\"auto\">Installing nvm on Alpine Linux</h2>\n<p dir=\"auto\">In order to provide the best performance (and other optimizations), nvm will download and install pre-compiled binaries for Node (and npm) when you run <code class=\"notranslate\">nvm install X</code>. The Node project compiles, tests and hosts/provides these pre-compiled binaries which are built for mainstream/traditional Linux distributions (such as Debian, Ubuntu, CentOS, RedHat et al).</p>\n<p dir=\"auto\">Alpine Linux, unlike mainstream/traditional Linux distributions, is based on <a href=\"https://www.busybox.net/\" rel=\"nofollow\">BusyBox</a>, a very compact (~5MB) Linux distribution. BusyBox (and thus Alpine Linux) uses a different C/C++ stack to most mainstream/traditional Linux distributions - <a href=\"https://www.musl-libc.org/\" rel=\"nofollow\">musl</a>. This makes binary programs built for such mainstream/traditional incompatible with Alpine Linux, thus we cannot simply <code class=\"notranslate\">nvm install X</code> on Alpine Linux and expect the downloaded binary to run correctly - you'll likely see \"...does not exist\" errors if you try that.</p>\n<p dir=\"auto\">There is a <code class=\"notranslate\">-s</code> flag for <code class=\"notranslate\">nvm install</code> which requests nvm download Node source and compile it locally.</p>\n<p dir=\"auto\">If installing nvm on Alpine Linux <em>is</em> still what you want or need to do, you should be able to achieve this by running the following from you Alpine Linux shell, depending on which version you are using:</p>\n<h3 dir=\"auto\">Alpine Linux 3.13+</h3>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"apk add -U curl bash ca-certificates openssl ncurses coreutils python3 make gcc g++ libgcc linux-headers grep util-linux binutils findutils\ncurl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash\"><pre class=\"notranslate\">apk add -U curl bash ca-certificates openssl ncurses coreutils python3 make gcc g++ libgcc linux-headers grep util-linux binutils findutils\ncurl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh <span class=\"pl-k\">|</span> bash</pre></div>\n<h3 dir=\"auto\">Alpine Linux 3.5 - 3.12</h3>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"apk add -U curl bash ca-certificates openssl ncurses coreutils python2 make gcc g++ libgcc linux-headers grep util-linux binutils findutils\ncurl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash\"><pre class=\"notranslate\">apk add -U curl bash ca-certificates openssl ncurses coreutils python2 make gcc g++ libgcc linux-headers grep util-linux binutils findutils\ncurl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh <span class=\"pl-k\">|</span> bash</pre></div>\n<p dir=\"auto\"><em>Note: Alpine 3.5 can only install NodeJS versions up to v6.9.5, Alpine 3.6 can only install versions up to v6.10.3, Alpine 3.7 installs versions up to v8.9.3, Alpine 3.8 installs versions up to v8.14.0, Alpine 3.9 installs versions up to v10.19.0, Alpine 3.10 installs versions up to v10.24.1, Alpine 3.11 installs versions up to v12.22.6, Alpine 3.12 installs versions up to v12.22.12, Alpine 3.13 &amp; 3.14 install versions up to v14.20.0, Alpine 3.15 &amp; 3.16 install versions up to v16.16.0 (<strong>These are all versions on the main branch</strong>). Alpine 3.5 - 3.12 required the package <code class=\"notranslate\">python2</code> to build NodeJS, as they are older versions to build. Alpine 3.13+ requires <code class=\"notranslate\">python3</code> to successfully build newer NodeJS versions, but you can use <code class=\"notranslate\">python2</code> with Alpine 3.13+ if you need to build versions of node supported in Alpine 3.5 - 3.15, you just need to specify what version of NodeJS you need to install in the package install script.</em></p>\n<p dir=\"auto\">The Node project has some desire but no concrete plans (due to the overheads of building, testing and support) to offer Alpine-compatible binaries.</p>\n<p dir=\"auto\">As a potential alternative, <a class=\"user-mention notranslate\" data-hovercard-type=\"user\" data-hovercard-url=\"/users/mhart/hovercard\" data-octo-click=\"hovercard-link-click\" data-octo-dimensions=\"link_type:self\" href=\"https://github.com/mhart\">@mhart</a> (a Node contributor) has some <a href=\"https://github.com/mhart/alpine-node\">Docker images for Alpine Linux with Node and optionally, npm, pre-installed</a>.</p>\n<p dir=\"auto\"><a id=\"user-content-removal\"></a></p>\n<h2 dir=\"auto\">Uninstalling / Removal</h2>\n<h3 dir=\"auto\">Manual Uninstall</h3>\n<p dir=\"auto\">To remove <code class=\"notranslate\">nvm</code> manually, execute the following:</p>\n<p dir=\"auto\">First, use <code class=\"notranslate\">nvm unload</code> to remove the nvm command from your terminal session and delete the installation directory:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"$ nvm_dir=&quot;${NVM_DIR:-~/.nvm}&quot;\n$ nvm unload\n$ rm -rf &quot;$nvm_dir&quot;\"><pre class=\"notranslate\">$ nvm_dir=<span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">${NVM_DIR<span class=\"pl-k\">:-</span>~<span class=\"pl-k\">/</span>.nvm}</span><span class=\"pl-pds\">\"</span></span>\n$ nvm unload\n$ rm -rf <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">$nvm_dir</span><span class=\"pl-pds\">\"</span></span></pre></div>\n<p dir=\"auto\">Edit <code class=\"notranslate\">~/.bashrc</code> (or other shell resource config) and remove the lines below:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"export NVM_DIR=&quot;$HOME/.nvm&quot;\n[ -s &quot;$NVM_DIR/nvm.sh&quot; ] &amp;&amp; \\. &quot;$NVM_DIR/nvm.sh&quot; # This loads nvm\n[[ -r $NVM_DIR/bash_completion ]] &amp;&amp; \\. $NVM_DIR/bash_completion\"><pre class=\"notranslate\"><span class=\"pl-k\">export</span> NVM_DIR=<span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">$HOME</span>/.nvm<span class=\"pl-pds\">\"</span></span>\n[ <span class=\"pl-k\">-s</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">$NVM_DIR</span>/nvm.sh<span class=\"pl-pds\">\"</span></span> ] <span class=\"pl-k\">&amp;&amp;</span> <span class=\"pl-cce\">\\.</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">$NVM_DIR</span>/nvm.sh<span class=\"pl-pds\">\"</span></span> <span class=\"pl-c\"><span class=\"pl-c\">#</span> This loads nvm</span>\n[[ <span class=\"pl-k\">-r</span> <span class=\"pl-smi\">$NVM_DIR</span>/bash_completion ]] <span class=\"pl-k\">&amp;&amp;</span> <span class=\"pl-cce\">\\.</span> <span class=\"pl-smi\">$NVM_DIR</span>/bash_completion</pre></div>\n<h2 dir=\"auto\">Docker For Development Environment</h2>\n<p dir=\"auto\">To make the development and testing work easier, we have a Dockerfile for development usage, which is based on Ubuntu 18.04 base image, prepared with essential and useful tools for <code class=\"notranslate\">nvm</code> development, to build the docker image of the environment, run the docker command at the root of <code class=\"notranslate\">nvm</code> repository:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"$ docker build -t nvm-dev .\"><pre class=\"notranslate\">$ docker build -t nvm-dev <span class=\"pl-c1\">.</span></pre></div>\n<p dir=\"auto\">This will package your current nvm repository with our pre-defined development environment into a docker image named <code class=\"notranslate\">nvm-dev</code>, once it's built with success, validate your image via <code class=\"notranslate\">docker images</code>:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"$ docker images\n\nREPOSITORY         TAG                 IMAGE ID            CREATED             SIZE\nnvm-dev            latest              9ca4c57a97d8        7 days ago          650 MB\"><pre class=\"notranslate\">$ docker images\n\nREPOSITORY         TAG                 IMAGE ID            CREATED             SIZE\nnvm-dev            latest              9ca4c57a97d8        7 days ago          650 MB</pre></div>\n<p dir=\"auto\">If you got no error message, now you can easily involve in:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"$ docker run -h nvm-dev -it nvm-dev\n\nnvm@nvm-dev:~/.nvm$\"><pre class=\"notranslate\">$ docker run -h nvm-dev -it nvm-dev\n\nnvm@nvm-dev:<span class=\"pl-k\">~</span>/.nvm$</pre></div>\n<p dir=\"auto\">Please note that it'll take about 8 minutes to build the image and the image size would be about 650MB, so it's not suitable for production usage.</p>\n<p dir=\"auto\">For more information and documentation about docker, please refer to its official website:</p>\n<ul dir=\"auto\">\n<li><a href=\"https://www.docker.com/\" rel=\"nofollow\">https://www.docker.com/</a></li>\n<li><a href=\"https://docs.docker.com/\" rel=\"nofollow\">https://docs.docker.com/</a></li>\n</ul>\n<h2 dir=\"auto\">Problems</h2>\n<ul dir=\"auto\">\n<li>\n<p dir=\"auto\">If you try to install a node version and the installation fails, be sure to run <code class=\"notranslate\">nvm cache clear</code> to delete cached node downloads, or you might get an error like the following:</p>\n<p dir=\"auto\">curl: (33) HTTP server doesn't seem to support byte ranges. Cannot resume.</p>\n</li>\n<li>\n<p dir=\"auto\">Where's my <code class=\"notranslate\">sudo node</code>? Check out <a href=\"https://github.com/nvm-sh/nvm/issues/43\" data-hovercard-type=\"issue\" data-hovercard-url=\"/nvm-sh/nvm/issues/43/hovercard\">#43</a></p>\n</li>\n<li>\n<p dir=\"auto\">After the v0.8.6 release of node, nvm tries to install from binary packages. But in some systems, the official binary packages don't work due to incompatibility of shared libs. In such cases, use <code class=\"notranslate\">-s</code> option to force install from source:</p>\n</li>\n</ul>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"nvm install -s 0.8.6\"><pre class=\"notranslate\">nvm install -s 0.8.6</pre></div>\n<ul dir=\"auto\">\n<li>If setting the <code class=\"notranslate\">default</code> alias does not establish the node version in new shells (i.e. <code class=\"notranslate\">nvm current</code> yields <code class=\"notranslate\">system</code>), ensure that the system's node <code class=\"notranslate\">PATH</code> is set before the <code class=\"notranslate\">nvm.sh</code> source line in your shell profile (see <a href=\"https://github.com/nvm-sh/nvm/issues/658\" data-hovercard-type=\"issue\" data-hovercard-url=\"/nvm-sh/nvm/issues/658/hovercard\">#658</a>)</li>\n</ul>\n<h2 dir=\"auto\">macOS Troubleshooting</h2>\n<p dir=\"auto\"><strong>nvm node version not found in vim shell</strong></p>\n<p dir=\"auto\">If you set node version to a version other than your system node version <code class=\"notranslate\">nvm use 6.2.1</code> and open vim and run <code class=\"notranslate\">:!node -v</code> you should see <code class=\"notranslate\">v6.2.1</code> if you see your system version <code class=\"notranslate\">v0.12.7</code>. You need to run:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"sudo chmod ugo-x /usr/libexec/path_helper\"><pre class=\"notranslate\">sudo chmod ugo-x /usr/libexec/path_helper</pre></div>\n<p dir=\"auto\">More on this issue in <a href=\"https://github.com/dotphiles/dotzsh#mac-os-x\">dotphiles/dotzsh</a>.</p>\n<p dir=\"auto\"><strong>nvm is not compatible with the npm config \"prefix\" option</strong></p>\n<p dir=\"auto\">Some solutions for this issue can be found <a href=\"https://github.com/nvm-sh/nvm/issues/1245\" data-hovercard-type=\"issue\" data-hovercard-url=\"/nvm-sh/nvm/issues/1245/hovercard\">here</a></p>\n<p dir=\"auto\">There is one more edge case causing this issue, and that's a <strong>mismatch between the <code class=\"notranslate\">$HOME</code> path and the user's home directory's actual name</strong>.</p>\n<p dir=\"auto\">You have to make sure that the user directory name in <code class=\"notranslate\">$HOME</code> and the user directory name you'd see from running <code class=\"notranslate\">ls /Users/</code> <strong>are capitalized the same way</strong> (<a href=\"https://github.com/nvm-sh/nvm/issues/2261\" data-hovercard-type=\"issue\" data-hovercard-url=\"/nvm-sh/nvm/issues/2261/hovercard\">See this issue</a>).</p>\n<p dir=\"auto\">To change the user directory and/or account name follow the instructions <a href=\"https://support.apple.com/en-us/HT201548\" rel=\"nofollow\">here</a></p>\n<p dir=\"auto\"><strong>Homebrew makes zsh directories unsecure</strong></p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"zsh compinit: insecure directories, run compaudit for list.\nIgnore insecure directories and continue [y] or abort compinit [n]? y\"><pre class=\"notranslate\">zsh compinit: insecure directories, run compaudit <span class=\"pl-k\">for</span> list.\nIgnore insecure directories and <span class=\"pl-k\">continue</span> [y] or abort compinit [n]<span class=\"pl-k\">?</span> y</pre></div>\n<p dir=\"auto\">Homebrew causes insecure directories like <code class=\"notranslate\">/usr/local/share/zsh/site-functions</code> and <code class=\"notranslate\">/usr/local/share/zsh</code>. This is <strong>not</strong> an <code class=\"notranslate\">nvm</code> problem - it is a homebrew problem. Refer <a href=\"https://github.com/zsh-users/zsh-completions/issues/680\" data-hovercard-type=\"issue\" data-hovercard-url=\"/zsh-users/zsh-completions/issues/680/hovercard\">here</a> for some solutions related to the issue.</p>\n<p dir=\"auto\"><strong>Macs with Apple Silicon chips</strong></p>\n<p dir=\"auto\">Experimental support for the Apple Silicon chip architecture was added in node.js v15.3 and full support was added in v16.0.<br>\nBecause of this, if you try to install older versions of node as usual, you will probably experience either compilation errors when installing node or out-of-memory errors while running your code.</p>\n<p dir=\"auto\">So, if you want to run a version prior to v16.0 on an Apple Silicon Mac, it may be best to compile node targeting the <code class=\"notranslate\">x86_64</code> Intel architecture so that Rosetta 2 can translate the <code class=\"notranslate\">x86_64</code> processor instructions to ARM-based Apple Silicon instructions.<br>\nHere's what you will need to do:</p>\n<ul dir=\"auto\">\n<li>\n<p dir=\"auto\">Install Rosetta, if you haven't already done so</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"$ softwareupdate --install-rosetta\"><pre class=\"notranslate\">$ softwareupdate --install-rosetta</pre></div>\n<p dir=\"auto\">You might wonder, \"how will my Apple Silicon Mac know to use Rosetta for a version of node compiled for an Intel chip?\".<br>\nIf an executable contains only Intel instructions, macOS will automatically use Rosetta to translate the instructions.</p>\n</li>\n<li>\n<p dir=\"auto\">Open a shell that's running using Rosetta</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"$ arch -x86_64 zsh\"><pre class=\"notranslate\">$ arch -x86_64 zsh</pre></div>\n<p dir=\"auto\">Note: This same thing can also be accomplished by finding the Terminal or iTerm App in Finder, right clicking, selecting \"Get Info\", and then checking the box labeled \"Open using Rosetta\".</p>\n<p dir=\"auto\">Note: This terminal session is now running in <code class=\"notranslate\">zsh</code>.<br>\nIf <code class=\"notranslate\">zsh</code> is not the shell you typically use, <code class=\"notranslate\">nvm</code> may not be <code class=\"notranslate\">source</code>'d automatically like it probably is for your usual shell through your dotfiles.<br>\nIf that's the case, make sure to source <code class=\"notranslate\">nvm</code>.</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"$ source &quot;${NVM_DIR}/nvm.sh&quot;\"><pre class=\"notranslate\">$ <span class=\"pl-c1\">source</span> <span class=\"pl-s\"><span class=\"pl-pds\">\"</span><span class=\"pl-smi\">${NVM_DIR}</span>/nvm.sh<span class=\"pl-pds\">\"</span></span></pre></div>\n</li>\n<li>\n<p dir=\"auto\">Install whatever older version of node you are interested in. Let's use 12.22.1 as an example.<br>\nThis will fetch the node source code and compile it, which will take several minutes.</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"$ nvm install v12.22.1 --shared-zlib\"><pre class=\"notranslate\">$ nvm install v12.22.1 --shared-zlib</pre></div>\n<p dir=\"auto\">Note: You're probably curious why <code class=\"notranslate\">--shared-zlib</code> is included.<br>\nThere's a bug in recent versions of Apple's system <code class=\"notranslate\">clang</code> compiler.<br>\nIf one of these broken versions is installed on your system, the above step will likely still succeed even if you didn't include the <code class=\"notranslate\">--shared-zlib</code> flag.<br>\nHowever, later, when you attempt to <code class=\"notranslate\">npm install</code> something using your old version of node.js, you will see <code class=\"notranslate\">incorrect data check</code> errors.<br>\nIf you want to avoid the possible hassle of dealing with this, include that flag.<br>\nFor more details, see <a href=\"https://github.com/nodejs/node/issues/39313\" data-hovercard-type=\"issue\" data-hovercard-url=\"/nodejs/node/issues/39313/hovercard\">this issue</a> and <a href=\"https://github.com/nodejs/node/issues/39313#issuecomment-90.40.376\" data-hovercard-type=\"issue\" data-hovercard-url=\"/nodejs/node/issues/39313/hovercard\">this comment</a></p>\n</li>\n<li>\n<p dir=\"auto\">Exit back to your native shell.</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"$ exit\n$ arch\narm64\"><pre class=\"notranslate\">$ <span class=\"pl-c1\">exit</span>\n$ arch\narm64</pre></div>\n<p dir=\"auto\">Note: If you selected the box labeled \"Open using Rosetta\" rather than running the CLI command in the second step, you will see <code class=\"notranslate\">i386</code> here.<br>\nUnless you have another reason to have that box selected, you can deselect it now.</p>\n</li>\n<li>\n<p dir=\"auto\">Check to make sure the architecture is correct. <code class=\"notranslate\">x64</code> is the abbreviation for <code class=\"notranslate\">x86_64</code>, which is what you want to see.</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"$ node -p process.arch\nx64\"><pre class=\"notranslate\">$ node -p process.arch\nx64</pre></div>\n</li>\n</ul>\n<p dir=\"auto\">Now you should be able to use node as usual.</p>\n<h2 dir=\"auto\">WSL Troubleshooting</h2>\n<p dir=\"auto\">If you've encountered this error on WSL-2:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash\n% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                Dload  Upload  Total   Spent    Left  Speed\n0     0    0     0    0     0      0      0 --:--:--  0:00:09 --:--:--     0curl: (6) Could not resolve host: raw.githubusercontent.com\"><pre class=\"notranslate\">curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh <span class=\"pl-k\">|</span> bash\n% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                Dload  Upload  Total   Spent    Left  Speed\n0     0    0     0    0     0      0      0 --:--:--  0:00:09 --:--:--     0curl: (6) Could not resolve host: raw.githubusercontent.com</pre></div>\n<p dir=\"auto\">It may be due to your antivirus, VPN, or other reasons.</p>\n<p dir=\"auto\">Where you can <code class=\"notranslate\">ping 8.8.8.8</code> while you can't <code class=\"notranslate\">ping google.com</code></p>\n<p dir=\"auto\">This could simply be solved by running this in your root directory:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"sudo rm /etc/resolv.conf\nsudo bash -c 'echo &quot;nameserver 8.8.8.8&quot; &gt; /etc/resolv.conf'\nsudo bash -c 'echo &quot;[network]&quot; &gt; /etc/wsl.conf'\nsudo bash -c 'echo &quot;generateResolvConf = false&quot; &gt;&gt; /etc/wsl.conf'\nsudo chattr +i /etc/resolv.conf\"><pre class=\"notranslate\">sudo rm /etc/resolv.conf\nsudo bash -c <span class=\"pl-s\"><span class=\"pl-pds\">'</span>echo \"nameserver 8.8.8.8\" &gt; /etc/resolv.conf<span class=\"pl-pds\">'</span></span>\nsudo bash -c <span class=\"pl-s\"><span class=\"pl-pds\">'</span>echo \"[network]\" &gt; /etc/wsl.conf<span class=\"pl-pds\">'</span></span>\nsudo bash -c <span class=\"pl-s\"><span class=\"pl-pds\">'</span>echo \"generateResolvConf = false\" &gt;&gt; /etc/wsl.conf<span class=\"pl-pds\">'</span></span>\nsudo chattr +i /etc/resolv.conf</pre></div>\n<p dir=\"auto\">This deletes your <code class=\"notranslate\">resolv.conf</code> file that is automatically generated when you run WSL, creates a new file and puts <code class=\"notranslate\">nameserver 8.8.8.8</code>, then creates a <code class=\"notranslate\">wsl.conf</code> file and adds <code class=\"notranslate\">[network]</code> and <code class=\"notranslate\">generateResolveConf = false</code> to prevent auto-generation of that file.</p>\n<p dir=\"auto\">You can check the contents of the file by running:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"cat /etc/resolv.conf\"><pre class=\"notranslate\">cat /etc/resolv.conf</pre></div>\n<h2 dir=\"auto\">Maintainers</h2>\n<p dir=\"auto\">Currently, the sole maintainer is <a href=\"https://github.com/ljharb\">@ljharb</a> - more maintainers are quite welcome, and we hope to add folks to the team over time. <a href=\"./GOVERNANCE.md\">Governance</a> will be re-evaluated as the project evolves.</p>\n<h2 dir=\"auto\">Project Support</h2>\n<p dir=\"auto\">Only the latest version (v0.40.3 at this time) is supported.</p>\n<h2 dir=\"auto\">Enterprise Support</h2>\n<p dir=\"auto\">If you are unable to update to the latest version of <code class=\"notranslate\">nvm</code>, our <a href=\"https://openjsf.org/ecosystem-sustainability-program\" rel=\"nofollow\">partners</a> provide commercial security fixes for all unsupported versions:</p>\n<ul dir=\"auto\">\n<li><a href=\"https://www.herodevs.com/support?utm_source=OpenJS&amp;utm_medium=Link&amp;utm_campaign=nvm_openjs\" rel=\"nofollow\">HeroDevs Never-Ending Support</a></li>\n</ul>\n<h2 dir=\"auto\">License</h2>\n<p dir=\"auto\">See <a href=\"./LICENSE.md\">LICENSE.md</a>.</p>\n<h2 dir=\"auto\">Copyright notice</h2>\n<p dir=\"auto\">Copyright <a href=\"https://openjsf.org\" rel=\"nofollow\">OpenJS Foundation</a> and <code class=\"notranslate\">nvm</code> contributors. All rights reserved. The <a href=\"https://openjsf.org\" rel=\"nofollow\">OpenJS Foundation</a> has registered trademarks and uses trademarks.  For a list of trademarks of the <a href=\"https://openjsf.org\" rel=\"nofollow\">OpenJS Foundation</a>, please see our <a href=\"https://trademark-policy.openjsf.org/\" rel=\"nofollow\">Trademark Policy</a> and <a href=\"https://trademark-list.openjsf.org/\" rel=\"nofollow\">Trademark List</a>.  Trademarks and logos not indicated on the <a href=\"https://trademark-list.openjsf.org\" rel=\"nofollow\">list of OpenJS Foundation trademarks</a> are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.<br>\n<a href=\"https://openjsf.org/\" rel=\"nofollow\">The OpenJS Foundation</a> | <a href=\"https://terms-of-use.openjsf.org/\" rel=\"nofollow\">Terms of Use</a> | <a href=\"https://privacy-policy.openjsf.org/\" rel=\"nofollow\">Privacy Policy</a> | <a href=\"https://bylaws.openjsf.org/\" rel=\"nofollow\">Bylaws</a> | <a href=\"https://code-of-conduct.openjsf.org\" rel=\"nofollow\">Code of Conduct</a> | <a href=\"https://trademark-policy.openjsf.org/\" rel=\"nofollow\">Trademark Policy</a> | <a href=\"https://trademark-list.openjsf.org/\" rel=\"nofollow\">Trademark List</a> | <a href=\"https://www.linuxfoundation.org/cookies/\" rel=\"nofollow\">Cookie Policy</a></p>","updatedAt":"2025-05-21T16:13:57Z","upvoteCount":null,"author":{"login":"eryajf","avatarUrl":"https://avatars.githubusercontent.com/u/33259379?u=e4a4090a38ac2473aaed4ef9945233636776c6c3&v=4","url":"https://github.com/eryajf"},"category":null,"labels":{"edges":[{"node":{"name":"更多","color":"25B472"}},{"node":{"name":"Version-Switch-Tools","color":"8ff216"}},{"node":{"name":"nvm-sh","color":"677910"}}]},"comments":{"edges":[]}}},"pageContext":{"number":408,"previous":{"title":"coreybutler/nvm-windows: 用于 Windows 系统中多个 Node 版本的管理与切换","number":407},"next":{"title":"keyval-dev/odigos: 分布式跟踪，无需更改代码。🚀 使用 OpenTelemetry 和 eBPF 即时监控任何应用程序","number":409}}},
    "staticQueryHashes": ["151096407","2861350382"]}