{"id":41966,"date":"2024-08-23T11:22:42","date_gmt":"2024-08-23T11:22:42","guid":{"rendered":"https:\/\/www.carmatec.com\/?p=41966"},"modified":"2026-02-17T10:33:30","modified_gmt":"2026-02-17T10:33:30","slug":"miten-asentaa-node-js-ja-npm-windows-macos-linuxiin","status":"publish","type":"post","link":"https:\/\/www.carmatec.com\/fi\/blog\/how-to-install-node-js-and-npm-on-windows-macos-linux\/","title":{"rendered":"Node.js:n ja npm:n asentaminen Windowsiin, macOS:\u00e4\u00e4n ja Linuxiin (2025 opas)"},"content":{"rendered":"<div data-elementor-type=\"wp-post\" data-elementor-id=\"41966\" class=\"elementor elementor-41966\" data-elementor-post-type=\"post\">\n\t\t\t\t<div class=\"elementor-element elementor-element-ee111f0 e-flex e-con-boxed e-con e-parent\" data-id=\"ee111f0\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-5ffcd61 elementor-widget elementor-widget-text-editor\" data-id=\"5ffcd61\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<h2><b>Johdanto<\/b><\/h2><p>Node.js is a powerful JavaScript runtime environment that enables you to run JavaScript code on the server side. npm (Node Package Manager) is the default package manager for Node.js and is essential for managing JavaScript packages and dependencies. In this guide, we\u2019ll walk you through the steps to install Node.js and npm on Windows, macOS, and Linux.<\/p><h2><b>1. Node.js:n ja npm:n asentaminen Windowsissa<\/b><\/h2><p><b>Vaihe 1: Lataa Node.js<\/b><\/p><ol><li aria-level=\"1\">K\u00e4y osoitteessa<a href=\"https:\/\/web.archive.org\/web\/20250817095856\/https:\/\/nodejs.org\/\">\u00a0Node.js virallinen verkkosivusto<\/a>.<\/li><li aria-level=\"1\">Lataa Windows-asennusohjelma (.msi) LTS-versiota (Long Term Support) varten.<\/li><\/ol><p><b>Vaihe 2: Asenna Node.js<\/b><\/p><ol><li aria-level=\"1\">Run the downloaded\u00a0.msi\u00a0file.<\/li><li aria-level=\"1\">Follow the installation prompts, ensuring that you check the box to include\u00a0npm\u00a0in the installation.<\/li><li aria-level=\"1\">Click \u201cNext\u201d and \u201cInstall\u201d to complete the setup.<\/li><\/ol><p><b>Vaihe 3: Asennuksen tarkistaminen<\/b><\/p><ol><li aria-level=\"1\">Avaa komentorivi.<\/li><li aria-level=\"1\">Type\u00a0node -v\u00a0to check the Node.js version.<\/li><li aria-level=\"1\">Type\u00a0npm -v\u00a0to check the npm version.<\/li><\/ol><h2><b>2. Node.js:n ja npm:n asentaminen macOS:lle<\/b><\/h2><p><b>Vaihe 1: Asenna Node.js Homebrew:n kautta<\/b><\/p><ol><li aria-level=\"1\">Avaa terminaali.<\/li><li aria-level=\"1\">Asenna<a href=\"https:\/\/web.archive.org\/web\/20250817095856\/https:\/\/brew.sh\/\">\u00a0Homebrew<\/a>\u00a0if you haven\u2019t already by running:<br \/><pre>\/bin\/bash -c \"$(curl -fsSL https:\/\/raw.githubusercontent.com\/Homebrew\/install\/HEAD\/install.sh)\"<\/pre><\/li><li aria-level=\"1\">Install Node.js and npm with:<br \/><pre>brew install node<\/pre><\/li><\/ol><p><b>Vaihe 2: Asennuksen tarkistaminen<\/b><\/p><ol><li aria-level=\"1\">In Terminal, type\u00a0node -v\u00a0to check the Node.js version.<\/li><li aria-level=\"1\">Type\u00a0npm -v\u00a0to check the npm version.<\/li><\/ol><p><b>Vaihtoehtoinen menetelm\u00e4: Lataa verkkosivustolta<\/b><\/p><ol><li aria-level=\"1\">K\u00e4y osoitteessa<a href=\"https:\/\/web.archive.org\/web\/20250817095856\/https:\/\/nodejs.org\/\">\u00a0Node.js virallinen verkkosivusto<\/a>.<\/li><li aria-level=\"1\">Download the macOS installer and run the\u00a0.pkg\u00a0file.<\/li><li aria-level=\"1\">Suorita asennus loppuun noudattamalla kehotteita.<\/li><\/ol><h2><b>3. Node.js:n ja npm:n asentaminen Linuxiin<\/b><\/h2><p><b>Vaihe 1: P\u00e4ivit\u00e4 paketti-indeksi<\/b><\/p><ol><li aria-level=\"1\">Avaa terminaali.<\/li><li aria-level=\"1\">Suorita seuraava komento p\u00e4ivitt\u00e4\u00e4ksesi paketti-indeksin:<br \/>sudo apt update<\/li><\/ol><p><b>Vaihe 2: Asenna Node.js ja npm<\/b><\/p><ul><li aria-level=\"1\"><b>Debian\/Ubuntu-pohjaisille jakeluille<\/b>:<br \/>sudo apt install nodejs npm<br \/><b><\/b><\/li><li aria-level=\"1\"><b>CentOS\/RHEL-pohjaisille jakeluille<\/b>:<br \/>sudo yum install nodejs npm<br \/><b><\/b><\/li><li aria-level=\"1\"><b>Fedoran osalta<\/b>:<br \/>sudo dnf install nodejs npm<\/li><\/ul><p><b>Vaihe 3: Asennuksen tarkistaminen<\/b><\/p><ol><li aria-level=\"1\">In Terminal, type\u00a0node -v\u00a0to check the Node.js version.<\/li><li aria-level=\"1\">Type\u00a0npm -v\u00a0to check the npm version.<\/li><\/ol><h2><b>Vaihtoehtoinen menetelm\u00e4: Asenna Node Version Managerin (nvm) kautta.<\/b><\/h2><ol><li>Install\u00a0nvm\u00a0(Node Version Manager) by running:<br \/><pre>curl -o- https:\/\/raw.githubusercontent.com\/nvm-sh\/nvm\/v0.39.2\/install.sh | bash<\/pre><\/li><li>Load\u00a0nvm:<br \/><pre>source ~\/bashrc<\/pre><\/li><li>Install Node.js using\u00a0nvm:<br \/><pre>nvm install node<\/pre><\/li><li><p>Verify by typing node -v and npm -v.<\/p><\/li><\/ol><h2><b>Johtop\u00e4\u00e4t\u00f6s<\/b><\/h2><div class=\"elementor-element elementor-element-ba04ed5 elementor-widget elementor-widget-theme-post-content animated fadeInDown\" data-id=\"ba04ed5\" data-element_type=\"widget\" data-settings=\"{&quot;_animation&quot;:&quot;fadeInDown&quot;}\" data-widget_type=\"theme-post-content.default\"><div class=\"elementor-widget-container\"><div class=\"elementor elementor-41966\" data-elementor-type=\"wp-post\" data-elementor-id=\"41966\" data-elementor-post-type=\"post\"><div class=\"elementor-element elementor-element-ee111f0 e-flex e-con-boxed e-con e-parent e-lazyloaded\" data-id=\"ee111f0\" data-element_type=\"container\"><div class=\"e-con-inner\"><div class=\"elementor-element elementor-element-5ffcd61 elementor-widget elementor-widget-text-editor\" data-id=\"5ffcd61\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\"><div class=\"elementor-widget-container\"><p>Installing Node.js and npm is straightforward, whether you\u2019re on Windows, macOS, or Linux. By following this guide, you\u2019ll have Node.js and npm up and running in no time, ready for your development projects. With\u00a0<a href=\"https:\/\/web.archive.org\/web\/20250817095856\/https:\/\/www.carmatec.com\/hire-developers\/hire-nodejs-developer\/\">Node.js<\/a>\u00a0installed, you\u2019re all set to explore the world of server-side\u00a0<a href=\"https:\/\/web.archive.org\/web\/20250817095856\/https:\/\/www.carmatec.com\/hire-developers\/hire-javascript-developer\/\">JavaScript<\/a>\u00a0ja alkaa rakentaa tehokkaita\u00a0<a href=\"https:\/\/web.archive.org\/web\/20250817095856\/https:\/\/www.carmatec.com\/web-application-development\/\">sovellukset<\/a>.<\/p><\/div><\/div><\/div><\/div><\/div><\/div><\/div>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>","protected":false},"excerpt":{"rendered":"<p>Introduction Node.js is a powerful JavaScript runtime environment that enables you to run JavaScript code on the server side. npm (Node Package Manager) is the default package manager for Node.js and is essential for managing JavaScript packages and dependencies. In this guide, we\u2019ll walk you through the steps to install Node.js and npm on Windows, [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":41972,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-41966","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog"],"_links":{"self":[{"href":"https:\/\/www.carmatec.com\/fi\/wp-json\/wp\/v2\/posts\/41966","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.carmatec.com\/fi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.carmatec.com\/fi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.carmatec.com\/fi\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.carmatec.com\/fi\/wp-json\/wp\/v2\/comments?post=41966"}],"version-history":[{"count":160,"href":"https:\/\/www.carmatec.com\/fi\/wp-json\/wp\/v2\/posts\/41966\/revisions"}],"predecessor-version":[{"id":51039,"href":"https:\/\/www.carmatec.com\/fi\/wp-json\/wp\/v2\/posts\/41966\/revisions\/51039"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.carmatec.com\/fi\/wp-json\/wp\/v2\/media\/41972"}],"wp:attachment":[{"href":"https:\/\/www.carmatec.com\/fi\/wp-json\/wp\/v2\/media?parent=41966"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.carmatec.com\/fi\/wp-json\/wp\/v2\/categories?post=41966"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.carmatec.com\/fi\/wp-json\/wp\/v2\/tags?post=41966"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}