How to Check if Npm Is Installed Windows
LearnInstall Node.js® and NPM on Windows: A How-To Guide
If you're looking to take your JavaScript coding to another level, Treehouse offers unlimited courses in JavaScript (and many other subjects) starting at $25/month. Try our program out with afree seven-day trial today.
JavaScript is quickly becoming the go-to language for web developers. Front-end web developers use JavaScript to add user interface enhancements, add interactivity, and talk to back-end web services using AJAX. Web developers who work on the server-side are also flocking to JavaScript because of the efficiencies and speed offered by JavaScript's event-driven, non-blocking nature.
In fact, concentrating on JavaScript as your language of choice offers the opportunity to master a single language while still being able to develop "full-stack" web applications. The key to this server-side JavaScript revolution is Node.js® — a version of Chrome's V8 JavaScript runtime engine — which makes it possible to run JavaScript on the server-side.
Node.js is also used for developing desktop applications and for deploying tools that make developing web sites simpler. For example, by installing Node.js® on your desktop machine, you can quickly convert CoffeeScript to JavaScript, SASS to CSS, and shrink the size of your HTML, JavaScript and graphic files. Using NPM — a tool that makes installing and managing Node modules — it's quite easy to add many useful tools to your web development toolkit.
In a previous article, I wrote about how to install Node.js® and, it's companion, NPM on a Mac. Fortunately, for Windows users, the Node.js® installation process is a lot easier than how I recommend installing Node.js® on a Mac.
Prerequisites
Node isn't a program that you simply launch like Word or Photoshop: you won't find it pinned to the taskbar or in your list of Apps. To use Node you must type command-line instructions, so you need to be comfortable with (or at least know how to start) a command-line tool like the Windows Command Prompt, PowerShell, Cygwin, or the Git shell (which is installed along with Github for Windows).
Installation Overview
Installing Node and NPM is pretty straightforward using the installer package available from the Node.js® web site.
Installation Steps
- Download the Windows installer from the Nodes.js® web site.
- Run the installer (the .msi file you downloaded in the previous step.)
- Follow the prompts in the installer (Accept the license agreement, click the NEXT button a bunch of times and accept the default installation settings).
- Restart your computer. You won't be able to run Node.js® until you restart your computer.
Test it!
Make sure you have Node and NPM installed by running simple commands to see what version of each is installed and to run a simple test program:
- Test Node. To see if Node is installed, open the Windows Command Prompt, Powershell or a similar command line tool, and type
node -v
. This should print a version number, so you'll see something like thisv0.10.35
. - Test NPM. To see if NPM is installed, type
npm -v
in Terminal. This should print NPM's version number so you'll see something like this1.4.28
- Create a test file and run it. A simple way to test that node.js works is to create a JavaScript file: name it
hello.js
, and just add the codeconsole.log('Node is installed!');
. To run the code simply open your command line program, navigate to the folder where you save the file and typenode hello.js
. This will start Node and run the code in thehello.js
file. You should see the outputNode is installed!
.
Check and Update Your Node and NPM Versions
New versions of Node and NPM come out frequently. To install the updates, just download the installer from the Nodejs.org site and run it again. The new version of Node and NPM will replace the older versions.
How to Uninstall Node and NPM
You uninstall Node.js and NPM the same as you would most Windows software:
- Open the Windows Control Panel
- Choose the "Programs and Features" option
- Click the "Uninstall a program" option
- Select Node.js, and click the Uninstall link.
With Node.js and NPM installed you'll soon be able to take advantage of the huge world of NPM modules that can help with a wide variety of tasks both on the web server and on your desktop (or laptop) machine. The NPM site lists all of the official Node packages making it easy to make the choice. Have fun!
Learn with Treehouse
Learning with Treehouse starts at only $25 per month. If you think you're ready to start exploring if tech is right for you, sign up for your free seven day trial.
What sets Treehouse apart is their dedication to helping you find your perfect job or develop your own business. – SwitchUp.org
Follow us on Twitter, Instagram, and Facebook for our favorite tips, and to share how your learning is going. We'll see you there!
If you liked reading this article, you should also look at these two:
- The Best Places to Look for Your First Tech Job
- 5 Treehouse Students Who Found Tech Jobs in Less than a Year
- code
- javascript
- node.js
Leave a Reply
You must be logged in to post a comment.
Want to learn more about Javascript?
Learn how to use JavaScript to add interactivity to websites.
Learn more
How to Check if Npm Is Installed Windows
Source: https://blog.teamtreehouse.com/install-node-js-npm-windows