Skip to content

Instantly share code, notes, and snippets.

@Mubirupatrick2040
Forked from bradtraversy/npmcrashcourse.txt
Created February 21, 2020 18:54
Show Gist options
  • Select an option

  • Save Mubirupatrick2040/5a5d9e2349754da499673fb5df60de45 to your computer and use it in GitHub Desktop.

Select an option

Save Mubirupatrick2040/5a5d9e2349754da499673fb5df60de45 to your computer and use it in GitHub Desktop.

Revisions

  1. @bradtraversy bradtraversy revised this gist Jan 25, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion npmcrashcourse.txt
    Original file line number Diff line number Diff line change
    @@ -58,7 +58,7 @@ npm list
    npm list --depth 0
    npm list --depth 1

    # INSTALL NODMON LOCALLY
    # INSTALL LIVE-SERVER LOCALLY
    npm install live-server --save-dev

    # NPM SCRIPT
  2. @bradtraversy bradtraversy revised this gist Sep 18, 2017. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion npmcrashcourse.txt
    Original file line number Diff line number Diff line change
    @@ -42,6 +42,7 @@ npm update lodash --save

    # INSTALL GLOBAL MODULE
    npm install -g nodemon
    npm install -g live-server

    # RUN NODEMON
    nodemon
    @@ -58,7 +59,7 @@ npm list --depth 0
    npm list --depth 1

    # INSTALL NODMON LOCALLY
    npm install nodemon --save-dev
    npm install live-server --save-dev

    # NPM SCRIPT
    "scripts": {
  3. @bradtraversy bradtraversy created this gist Sep 18, 2017.
    67 changes: 67 additions & 0 deletions npmcrashcourse.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,67 @@
    # GET VERSION
    npm -v (or --version)

    # GET HELP
    npm help
    npm

    # CREATE PACKAGE.JSON
    npm init
    npm init -y (or --yes)

    # SET DEFAULTS
    npm config set init-author-name "YOUR NAME"
    npm set init-license "MIT"

    # GET DEFAULTS
    npm config get init-author-name
    npm get init-license

    # REMOVE DEFAULTS
    npm config delete init-author-name
    npm delete init-license

    # INSTALLING LOCAL PACKAGES
    npm install lodash --save (or npm install --save lodash)
    npm install moment --save
    npm install gulp gulp-sass --save-dev

    # MOVE TO ANOTHER FOLDER
    npm install
    npm install --production

    # REMOVING MODULES
    npm uninstall gulp-sass --save-dev
    npm remove gulp --save-dev

    #INSTALL CERTAIN VERSIONS
    npm install lodash@4.17.3 --save

    # UPDATE
    npm update lodash --save

    # INSTALL GLOBAL MODULE
    npm install -g nodemon

    # RUN NODEMON
    nodemon

    # FIND ROOT FOLDER
    npm root -g

    # REMOVE GLOBAL PACKAGES
    npm remove -g nodemon

    # LISTING PACKAGES
    npm list
    npm list --depth 0
    npm list --depth 1

    # INSTALL NODMON LOCALLY
    npm install nodemon --save-dev

    # NPM SCRIPT
    "scripts": {
    "start": "node index.js",
    "dev": "live-server"
    },