Skip to main content

about 4 years ago Syntax Podcast

Potluck! Node Versions, Old Man Internet, Responsive Design + MORE

Wes Bos

Wes Bos Host

Scott Tolinski

Scott Tolinski Host

Sponsored by Prismic, Sentry, FreshBooks

Guest 1

Rid. I I had it on all of my servers, Like, not the latest, latest. Like, if a 4.6 comes out or a 5 comes out, you're not going to get that, Node and the older version of your project was installed with a different version. So Generally, the way that I'll approach one of these things is, rid Like the brutal terminal that comes by default, you know, or the prompt. Sorry. Brutal brutal prompt. Yeah.

Guest 1

Sentry error exception performance tracking, and FreshBooks online accounting bookkeeping what version of Node you're on, and then you're going down the rabbit hole of trying to figure out that out. So it's a bit easier with like, full node versions.

Guest 1

the host at headless CMS,

Guest 2

I really want that. I know every I think about installing ZSH on, like, everything. Like, whether it's Yeah. My My Raspberry Pi or any of that stuff. I'm like, well, yeah. Take some time to install some ZSH on here, and then think about it. I'm like, I think I can get by ethically.

Guest 1

rid. What a awful, like, initial experience. You know? Yeah. I hear you. Alright. Let's get into the first question here from Nick Hebert.

Guest 1

He always had to type PWD to find out where you are, and because I've said this many times is web development projects rot Over time, mean that you unfortunately first, you can throw the entire thing into that you haven't touched in a while? Is perhaps the version of node for the project isn't installed in your machine? I generally find this happens. My solution is recreating the project every single time, which isn't sustainable, file, especially if you're just using Node v like most of us, you're rid. Just using Node in your command line

Guest 2

prompt? Or It's a zedash prompt and

Guest 1

We're gonna get right into it. We're sponsored by 3 awesome companies today. Prismic, rid. They are rid Most cases, it's not a big deal, but it could it could be. So nuke the node modules folder and run npm install again, rid. When you're SSH ing into another box,

Guest 2

Doing good, man. I'm I'm, Just tweaking my tweaking my shell here a bit. Not my turtle shell. My, or not my prompt. I guess it's my prompt. My my prompt.

Guest 2

A lot of really nice config options, a lot of really nice default themes, and a ton of really interesting features. So I don't know. Give them a check. That's cool. I,

Topic 1 07:23

Setting 'engineStrict' in .npmrc

Guest 1

in your npmrc And now 4.2.6 which is great because, like, you have you ever, like, you log in to a server or even you log in to your Synology And like you've lost all your Yeah. I hate it. Everything that makes you comfortable in the shell. So one of the features of of warp is supposed to be that you keep all of that and all of your shortcuts Cuts and everything. I could get to work. I don't know what what I'm doing wrong, but, field in your package. Json, and it will warn. So you can set your engines for npm and for node, Very rarely do projects drop, software. We'll talk about all of them partway through the episode. With me, as always, is mister Scott Talinski. How are you doing today, Scott? Hey.

Topic 2 03:58

Reinstall dependencies and node modules

Guest 1

Second, generally, when you switch node versions,

Guest 1

on your project. So just nuke the node modules folder.

Guest 1

You're going to want to do an npm install again on it. And, I was very happy. Although, like, one of the features of Warp is the ability to keep all of your prompt and everything

Topic 3 05:27

Gatsby and Node version issues

Guest 2

something because we wanted to take advantage of the new patch package stuff that's built in. And so I added these rid. Support. And sure enough, when I went to deploy my site, it yelled at me saying my node version wasn't high enough, so I, had to tweak my node version. So, yeah, I use that engines to make sure

Guest 2

a Yeah. I I'm I'm trying to own my posh. I don't know if you've seen that, but it's pretty neat. Is that a is that a sh

Guest 2

and you can specify

Guest 2

property,

Guest 2

They like a greater than 17 point o whatever for node version, but also for PNPM version. We recently updated our PNPM to version 7, rid. Specifically, 75

Guest 2

That but I I like to keep on top of that anyways just They have a newer version of Node. You know, you gotta have those latest goodies and all that stuff. So you know what I I found interesting, Wes, is that, you know, you've been using PNPM. Right? Yeah. PNPM has a thing in their package dot JSON Oh. That allows you to specify the node version. And that this might be things in in outside of PNPM as well. But in PNPM, you can have an engine's

Topic 4 04:10

Deleting package-lock.json

Guest 1

like let's say it was working on 4.2.1 I guess I didn't need a whole lot of stuff in there, but it was nice to just have a have it better than you're gonna you're not really gonna have it. Have you have you run into that where, like, oh, like, it was made on Node 15. Like, Some of my stuff runs 10 versions node old, and it still works great. I actually do run into that at at various points where, rid literally everything about the project into its own image so that other things on your computer are not rid not running like giving you you grief about that type of thing.

Guest 1

but you'll get the minor version released. And rid. I recently switched over to Warp, and they because they finally let you use your existing prompt and it was great. I just and I just set up the, like, prompt to be random.

Guest 1

is out. If you nuke your your package lock, you're gonna get the latest 4.2.6.

Guest 1

and that usually gets you there.

Guest 1

version of every package was used to install were running. So if you delete the package lock,

Guest 1

Then you are going to get the latest, what or you can set the exact version that you need.

Topic 5 02:38

Resolving NPM errors in old projects

Guest 1

And the projects will never continue.

Guest 1

rid is really a big issue for you or this is mission critical, you could throw this entire thing into a Docker image. And what that will allow you to do is to rid Isolate Rid. And if you do not have that version, it will throw a warning.

Guest 1

Gatsby JS, in this instance, big fan of the show. Alright. Yeah. That can be a bit of an issue Sometimes delete the package lock file, but the benefit of the package lock file is that it spells out exactly How do you generally resolve errors when starting up a project with NPM can't just leave them,

Topic 6 05:02

Node version compatibility

Guest 1

Unless you're coming, like, if if this

Topic 7 06:37

Specifying Node version in package.json

Guest 1

never been one to, like, oh, let's make a Docker image of this. And I know there's people that are bonkers over are doing everything Docker, but Yeah. It's not for me. But That engine's property is a standard You can also, that whoever's running it isn't running on an older version, but I I don't get too much into the Docker stuff myself. No. Me neither. Like, I've I've never been, like, a fan. I I understand the benefit, and I use Docker for everything on my Synology. But rid. I've I can't seem to find the node version for the projects.

Guest 1

rid. And you can set, like, greater than or equal to and less than or equal to,

Topic 8 00:00

Transcript

Announcer

You're listening to Syntax, the podcast with the tastiest web development treats out there. Strap yourself in and get ready. Here is Scott Talinski and Wes Boss.

Topic 9 05:08

Old projects working on new Node versions

Guest 2

Just something will work. Even I think there was, like, a Svelte could update I did recently where they popped up the node version I had to update. But I I actually found it quite a bit with, rid I think it was, like, Gatsby projects in the past to, like, change the node version.

Guest 1

rid 3 years later, and you're updating versions of You can put an engine strict equals true flag and it will literally not let you start it. That's kind of a pain because then like because NPM itself doesn't have a way to switch Welcome to Syntax. We got a potluck for you today. This is where you send in the questions. We will ready. Answer them. It's a great episode full of all kinds of really good questions.

Share

Empowering developers for over 286199464809 milliseconds!