// Tutorial //

How to Install Node.js with the Help of Tristram Shandy

Published on April 1, 2022 · Updated on April 1, 2022
    Default avatar
    By Alex Garnett
    Senior DevOps Technical Writer
    How to Install Node.js with the Help of Tristram Shandy

    Introduction

    It is sometimes true that when you are bringing javascript into the world, you can tell that this particular javascript is perhaps not to have a happy life.

    The Battle of the Cataplasm

    However, by utilizing the fundamentals of package management, you can divest yourself of this burden just a little. You see: your Stack may runneth over, your dependencies may resemble a knotted hair-net, and you will borrow and steal until you have at last written as little javascript as possible, which is after all the goal. Clamber up the shoulders of giants, that you might see the ships in the harbor! Why, when I was myself a boy, I did just that. Somehow I kicked my uncle in the eye in doing so; — he was half-blind for weeks and never quite forgave me. But, then, no one ever said that standing on the shoulders of giants, or for that matter regular-sized adults, would be altogether nonviolent. No one, I think, likes to be used as a stepladder, however noble your purpose. Nor in my experience will they stand still long enough for you to set up a proper ladder next to them.

    You, the reader, have embarked on a journey which will send you wandering in the fresh cut fields alongside the shaggiest of shaggy dog scripting languages, and I am to be your scientifick guide. It has admittedly been some time since I was last able to impart my favorite tips and tricks, but I have been brooding on them like a good mother hen; — rejoice, for the javascript is upon us. We will install Node.js, and we will avoid indigestion. Well, one or the other, at least.

    Prerequisites

    I should have mentioned: there are no prerequisites to this tutorial save for having given much thought to one’s own life up to now, and to have given due thought to one’s parents’ lives, and to one’s uncle’s lives, depending on how many uncles one has had; — as well as to have considered the entire history of computing, how it was invented and made real over so many years, how it came to displace so many of our animal spirits, and, not least, how your own computer, on which you read this very text, journeyed to your home from wherever it was begot. Pray, how might your life have been different if you had never come into contact with a computer such as this one? I tremble to think that you will never know.

    At this point you will have set down a fine foundation for the tutorial and may continue.

    Although, I beg your pardon, one small detail, you must first install Linux upon the computer. In truth I nearly forgot this part. When I was in the late spring of my youth, I had my own “year of Linux on the desktop” if you take my meaning. It’s just– I worry, really I worry, that so many such meditations on sowing Linux in one’s garden, one’s computer garden, can be perhaps a little too terse. I maintain here that one ought to know the whole of Linux, its whole prelude and such.

    The story, as it has been told to me, takes us back to a venture called Bell Laboratories, which I have always thought especially precious, imagine a laboratory dedicated to—

    Note: This part of the original manuscript was destroyed and cannot be reproduced here.

    Step 1 — Steeling One’s Loins to Install Node.js

    Thus,— thus my fellow laborers and associates in this great harvest of our learning, we shall ready ourselves to ready ourselves to ready ourselves to run javascript from the command line.

    It strikes me, though, that these “command lines” have an almost martial character. Now, I may not have any military experience per se, but I have listened to my uncle talk about his military service a very great deal, so it seems to me that I am qualified to comment on this subject.

    But I am getting ahead of myself. I remember one day when Uncle was expounding on the best ways of structuring a command line in order to discourage its little soldiers from running away en masse… On that day I was afflicted with the most grievous rash! But as it had little to do with my endeavors on the computer I shall, in turn, endeavor not to worry you with the rash’s tale.

    Anyhow, I was about to expiate the finer points of customizing one’s terminal … when I found I could not focus my mind for any length of time away from that pitiable rash. I remember my eldest brother developed a rash which at least a little resembled this one the first time he was away from the family estate on business.

    I believe it would be a mistake to assume my brother’s rash did not, in some way, prefigure javascript.

    The Siege of Namur

    Step 2 — Appraising the Essential Qualities of Node.js

    I do quite like the semicolons.

    I think javascript has an essentially obliging quality, always to politely let variables be something or other. To each variable its declaration; nothing is implicit. Good, good. Of course, if they are not let, they are constant — but then, constancy is not always the virtue that it imagines itself to be. To be trapped with an unchanging variable is, amen, not so unlike being trapped in a marriage, which is what became of my great-uncle. Really it took the spirit out of him over so many years… I think he felt quite diminished, constantly having to pay his wife’s debts by returning over and over to his most famous acting role: the rear end of a pantomime horse. But imagine if he were trapped in a variable declaration! Imagine his little squeaking voice… “help, I’m down here in this lodash, someone get me out, help, help!”

    This is improved if you imagine doing the voice out of the little corner of your mouth.

    I must also note here that I find the inconsistent application of require strict; in modern-day — was it — eczema script, terribly vexing. The incantation is admirable, enough on its own to keep me a-going; would that we had all had such a firm hand taken with us. In fact I chanced recently to be walking to my uncle’s office alongside a neighbor woman whose schoolboy son was with her and who would not stop pelting me with rocks, and I offered that she might require strict; with the lad.

    Warmly (somewhat), she said to me, go away. I wonder if perhaps I was not in the right there.

    Step 3 — Thinking About Your Mother

    Of course you ought not let the javascript appear to you as some dismal Scheherazade, stewarding you through memory; — some indulgence, granted, is unavoidable. I, for example, dream of being able to speak with my mother’s midwife at the moment of my deliv’rance, to say: “look! That’s me over there! I’m a baby!”

    I am much aware that javascript’s history — much like my own history — is chock-a-block with naysayers, who are ready to list at a moment’s notice all of the vocations to which it is ill-suited. To them I say, if javascript can run on the command line, why not invent time travel using javascript?

    Points in its favor are thus:

    • No one else has invented it so far, therefore this approach must be at least as good.
    • I know this language already and I don’t want to learn another one.

    So far it has been surprisingly challenging to raise sufficient venture capital on my family estate in order to hire javascript developers for this project of mine; everyone seems mostly to want to talk about real estate, or tulip futures. Alas, the technickal industry is quite competitive.

    Now, as I had already been at pains, earlier in this tutorial, to impart the right state of mind for installing Node.js, I trust that state of mind will linger a while yet, and I might be afforded a tiny detour.

    The overthrow of Dr. Slop

    Step 4 — Some Brief Opinions on Package Management

    I understand that Node.js has its own package manager.

    Personally, I like to imagine this so-called “package manager” as a faithful homunculus, fetching software and other sundries from the shop down the street, save for that the street is also in the computer, and the shop makes no money at all. npm is his name, and thusly: “En-pee-em!” I screech and beckon, as mine own father might’ve at day laborers. “En-pee-em!”

    Sometimes En-pee-em returns me the wrong library, and while my mind fills with thoughts of retribution, instead I remind myself, I must learn his hermeneutic ways, I must make my own way in the world. Recently we had a terrible episode;— he was making pitiful excuses about how some new wondrous physick had to be “installed globally,” and all at once I was consumed instead by dark thoughts of Uncle. Nothing would have sated him more than to have installed himself globally in his many trades!

    As the reader has already learnt so much about javascript in this tutorial, perhaps they would instead like to consider the many ideas I have had for En-pee-em and I to go on wild adventures together. For one, I have never been to France, though I haven’t yet decided if I would like to visit.

    Summarily, though, I would like to have En-pee-em take one of my own javascript packages to the shop someday, to share with others.

    Conclusion

    I have agreed to no such “conclusion.”

    Note: In order to install Node.js, please refer to the work of DigitalOcean’s other authors.


    Want to learn more? Join the DigitalOcean Community!

    Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in our Questions & Answers section, find tutorials and tools that will help you grow as a developer and scale your project or business, and subscribe to topics of interest.

    Sign up
    About the authors
    Default avatar
    Senior DevOps Technical Writer

    Still looking for an answer?

    Was this helpful?
    Leave a comment