Skip to content

Instantly share code, notes, and snippets.

@nirajgiriXD
Last active July 12, 2024 08:41
Show Gist options
  • Save nirajgiriXD/d84a5d75395ee14d9922138b6e4249b3 to your computer and use it in GitHub Desktop.
Save nirajgiriXD/d84a5d75395ee14d9922138b6e4249b3 to your computer and use it in GitHub Desktop.
Useful NPM commands

NPM:

npm -v
npm audit
npm audit fix
npm cache clean
npm init -y	
npm i
npm i -g <package-name>	
npm i -D <package-name>	
npm i --same-dev <package-name>
npm install <package-name@version>
npm link
npm link <package-name>
npm list -g
npm outdated
npm publish
npm rebuild
npm remove <package-name>	
npm run build	
npm run lint:js	
npm run lint:css	
npm run lint:css -- --fix	
npm stylelint --fix path/to/css/files/**/*.css	
npm uninstall <package-name> 
npm unlink -g <package-name>
npm unpublish
npm view <package-name> 

NPM: (React)

npm create vite@latest	
npm create [email protected]	

NPM: (React Native)

npx create-expo-app <app-name>

NPM: (NextJS)

npx create-next-app@latest	
npx [email protected]	

NVM:

nvm alias <name> <version>
nvm alias default <version>
nvm current
nvm install <node_version>
nvm ls
nvm use <node_version>

Node:

node -e "<code-snippet>"
node -v
node <filename.js>
node --inspect <filename.js>
node --trace-warnings <filename.js>
NODE_ENV=production node <filename.js>
TZ=America/New_York node <filename.js>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment