I can't find any straightforward instructions on this. I've installed node.js and npm, then created a project in its own folder, D:\node_stuff
, then cd'd there via cmd
(Windows 10) and ran npm install express
, npm init
. I'm trying to use gifify, and installed its dependencies via npm
instead of brew
(ffmpeg, imagemagick, giflossy).
gifify -h
-> 'gifify' is not recognized as an internal or external command,
operable program or batch file.node gifify -h
-> Error: Cannot find module 'D:\node_stuff\gifify'cd node_modules
-> node gifify -h
-> nothing happensWhat am I doing wrong? Where do I even look - all tutorials with simple search only show how to install packages or build a project - I don't need to build anything, only to use this one module.
You can run npx gifify -h
.
Generally, you have two options when installing NPM packages:
npm install gifify -g
npm install gifify
(or npm install
if the package is listed in package.json)Some packages, when installed, also install a command-line script. For globally-installed packages, that CLI script is installed to a location that is in your PATH and hence you can simply run the bare command e.g. gifify -h
. For locally-installed packages, that CLI script is installed locally under the node_modules
folder, which is not in your PATH. To run such a script you can use the NPM package executor npx, for example npx gifify -h
. This essentially executes the local script from the node_modules/.bin
folder.
If your package script, e.g. gifify
, relies on third-party executables such as FFMPEG and ImageMagick, then I would install those as regular applications (which will put them on your PATH).