Last active
September 29, 2024 21:04
-
-
Save bradtraversy/09177818de0f43a6e74e2cd05d1fe596 to your computer and use it in GitHub Desktop.
NPM Crash Course Commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 [email protected] --save | |
# UPDATE | |
npm update lodash --save | |
# INSTALL GLOBAL MODULE | |
npm install -g nodemon | |
npm install -g live-server | |
# 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 LIVE-SERVER LOCALLY | |
npm install live-server --save-dev | |
# NPM SCRIPT | |
"scripts": { | |
"start": "node index.js", | |
"dev": "live-server" | |
}, |
Thanks a lot Brad !
Thanks, Brad! much appreciated
Thanks for this cheat sheet. Helps a lot!
I am in love with Brad❤
Thank you Brad!
Love ya bro
Thank you so much sir ❤❤❤❤
Thanks for sharing it, I appreciate you sir. RatedWriting's GrabMyEssay review unfolds like a well-crafted narrative, offering a deep dive into the service's strengths and weaknesses visit this website for information. As a student seeking reliable evaluations, RatedWriting proves to be a dependable ally. The thorough examination of GrabMyEssay ensures that users embark on their academic assistance journey well-informed.
Thanks so much for this. Really appreciate what you do sir.👍
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you Brad!