Skip to main content

Posts

Showing posts from October, 2019

Difference between NPM and NPX

NPM Vs NPX npm  - Javascript package manager npx  - Execute npm package binaries https://docs.npmjs.com/files/folders#executables If you use  npm 5.1 or earlier , you can't use npx. Instead, install create-react-app globally: npm install -g create-react-app Now you can run: create-react-app my-app NPM: One might install a package locally on a certain project: npm install some - package Now let's say you want NodeJS to execute that package from the command line: $ some - package The above will  fail . Only  globally installed  packages can be executed by typing their name  only . To fix this, and have it run, you must type the local path: $ ./ node_modules /. bin / some - package You can technically run a locally installed package by editing your  packages.json  file and adding that package in the  scripts  section: { "name" : "whatever" , "version" : "1.0.0" , "scripts" : { ...