

Install an Editor Recommended: JetBrains IntelliJ/WebStorm (IDE) or VSCode (Text Editor) Npm-do babel-node index.js # `npm bin`/babel-node index.js Run executables from the nearest node_modules/.bin: npm-do nodemon #. eslintrc: ' echo $npmdo > ~/.bash_profile # Persist alias source ~/.bash_profile # Load in current shell eslintrc file at the root of our project and fallback to ~/.eslintrc. npm install -g babel-eslintĮslint can be run directly, but more often will be utilized through IDE or editor integration. To avoid common mistakes, we'll use eslint to check our code while developing. See the npm documentation on fixing permissions for a more comprehensive explanation of the above. # Linux echo $npmpath > ~/.bashrc & source ~/.bashrc # Option 2, Step 2a: Persist the custom npm install directory npmpath = 'export PATH=`npm config get prefix`/bin:$PATH' # Option 2, Step 2b: Add to your executable path # OSX echo $npmpath > ~/.bash_profile & source ~/.bash_profile Mkdir ~/.npmprefix & npm config set prefix ~/.npmprefix Sudo chown -R $(whoami ) `npm config get prefix ` # Option 2, Step 1: Set the npm install path to a custom directory Npm install -g If that fails for permission reasons, you have 2 options: # Option 1: chown the install directory e.g. ( Summary: -g packages are executable in the terminal, local packages can be loaded programmatically with require()) # npm is updated more frequently than node # So, let's install the latest npm For an explanation, see global vs installed packages. Note: Throughout this setup we'll be using -g to install packages. Nvm alias default stable # Set as version to load by default in the future Alternative Installation Paths:ĭownload from Verify npm Install Nvm install stable # Install latest stable version NVM supports nearly every version of node.js and enables both quick transitions between versions and switching on a session basis.


This document is a quick guide to preparing for node.js Development.
