Installing Sass locally using NPM

NPM & the Node Ecosytem

node.js

An open source JavaScript runtime, allows developers write and run JS app on the server. Can also be used to write tools to help with local web development.

NPM

Node Package Manager. Command line interface to allow installation and management of packages on local systems.

Make sure the latest version of node.js is installed (download from node.js website).

node -v on the command line will inform you what version of node.js is on the system.

package.json

First thing to create when creating a new project. Will contain the definitions of the project and where NPM will install the tools and packages its required.

npm init will help you create a package.json file.

You can use pakage.json file to install all the dependencies if you need to work on the project elsewhere, just type npm install

Install Sass

$ npm install node-sass --save-dev

Use NPM to install other dependencies such as jquery (include –save)

npm install jquery --save

This will show in the dependencies (not the devdependencies.

When setting up GIT, make sure to ignore all node_modules so as not to include all the dependencies

Leave a Reply

Your email address will not be published. Required fields are marked *