Skip to content

Instantly share code, notes, and snippets.

@andilabs
Last active September 21, 2017 12:01
Show Gist options
  • Save andilabs/bbce1f00eab10d660730615439f7ce11 to your computer and use it in GitHub Desktop.
Save andilabs/bbce1f00eab10d660730615439f7ce11 to your computer and use it in GitHub Desktop.
react basics

https://coolestguidesontheplanet.com/installing-node-js-on-macos/

install nodejs:

sudo apt-get install nodejs

init a directory for NPM (Node Package Manager) development:

npm init

this let you create basic package.json setup. If you would like install something to be added to this package (flag -s is ruccial for adding that) run:

npm install {your_favourite_library} -s

after running this command:

  • node_modules directory will be created
  • dependency will be added to package.json

you can for test remove wholde node_modules and call again npm insall inside the directory with package.json and all the staff listed there will be installed.

to check what is currently installed:

npm ls

running dev server with content of 'src':

webpack-dev-server --content-base src

install webpack

npm install webpack -g

weback.config.js for config how webpack should work

if you face:

ERROR in Cannot find module 'babel-core'

install:

npm install babel-core babel-loader --save-dev -S

https://stackoverflow.com/questions/35215461/error-in-cannot-find-module-babel-core-using-react-js-webpack-and-express-s/35219404#comment79646407_35219404

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment