Install Node and NVM on M1, M1 Pro, M1 Max Macs

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everybody alex here i'm continuing the series where i'm showing how to do stuff with the new m1 max now this is the m1 pro 14 inch machine and i'm setting it up to do web development so i'm going to need note on it i've already installed homebrew on it if you missed that video check that out i'll link to it down below i am going to use homebrew to keep going and install nvm which is node version manager so i can have multiple versions of node running on this machine i currently don't have node installed as you can see but i do have homebrew installed there you go so let's kick things off by installing nvm so brew install nvm and that is that so nvm help is not found well there's one more step you have to do and that's to add this line to your configuration file that's the z shell rc file it also says you should create nvm's working directory if it doesn't exist this one right here let's check to see if that directory exists you know what i'm just going to go ahead and run this command because if it doesn't it'll create it there we go not a fully automated process but at least it tells you what to do i also don't believe this computer is really new so i don't believe i have that configuration file the zs hrc file let's take a look yeah i don't have that file so i'm gonna create it and i'm gonna say touch and then the file name and now if i do a listing there it is now i have that file it's empty right now but i'm gonna put something in it and i'm gonna put this line in it right here so let's copy that and uh i'm just gonna do it in vs code let's pop open that file and add that line but that's not the only thing we need to add to this file in fact i've added a couple more things to get this working first we need a local variable for the brewpath to point to where that path is because it's not in a standard location if you see in my homebrew video you've seen me talk about that it's an opt homebrew bin on apple silicon and there is the opt path for homebrew and here is the nvm path that's the one we just specified then i export the brew path adding it to the path now i have the mvm directory exported also now here is the part that's important this loads nvm and i have a comment there that says that we look at the brew path nvm and then nvm sh so we execute that file to load it up and then we also have completion for mvm that also loads up now we should be ready to go and if i type in nvm help here we get the help usage there so now in order to install node i should just be able to say nvm install node and that should just work so let's do that and look at that because i didn't specify the version of node i want it it grabs the latest which is 17 so if i check node version now it says i have 17. if we take a look at the node website here you'll see that 17 is the current version however 16 as at the time of this video is the long term support version that's what lts means long term support so most likely you're going to want the even numbered version which is 16 18 20 and so on instead of the most current one which is probably not going to be supported by all your tooling yet so what i'm going to do is say nvm installed node at 16 and well that didn't work did it let's go with nvm ls remote this is going to give me all the versions looks like my syntax was wrong i apologize for that you just specify the version that you want instead of node at nvm install 16 and it's as easy as that so now i have node and then version 16. now if i want to use 17 which is already installed i can just say nvm use 17 and now if i check version i have version 17. so i can switch between the two versions of node and if i want to go back to 16 which is the case for my situation i want to use 16 i could just say nvmu16 and now i'm on version 16. that's homebrew endnote out of the way done subscribe to the channel for more tutorials like this as well as more tests now that we've got node installed we're going to be doing some javascript tests react angular view and of course some of the native tools that use javascript like some mobile application frameworks like native script and react native and so on thanks for watching folks i'll see you next time
Info
Channel: Alex Ziskind
Views: 14,220
Rating: undefined out of 5
Keywords: apple m1, apple m1 chip, apple silicon, apple silicon chip, apple silicon mac, apple silicon macbook, apple silicon macbook air, apple silicon macbook pro, apple silicon macs, m1 chip, mac with m1 chip, macbook air, macbook air m1, macbook pro 2020, macbook pro m1, new macbook pro, apple silicon web developer, apple m1 javascript, m1 javascript, m1 node js, m1 pro, m1 max, homebrew, node, nvm
Id: AEuI0PBvgfM
Channel Id: undefined
Length: 4min 54sec (294 seconds)
Published: Mon Nov 08 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.