anyone got the idea why my postcss is not recognized when installed locally with npm? I've tried with postcss in dependecies, and devDependency aswell. its so frustrating. Tried to run it also from ./node_modules
and ./node_modules/postcss-cli
i DID install postcss and postcss-cli. When installed globally, everything works, but i need to have it installed locally.
CodePudding user response:
The CLIs that come with npm
packages that are installed project-locally are not added to the PATH
environment variable, so they cannot be invoked by name only.
However, npm
provides helper utility npx
for invoking such project-local CLIs:
npx postcss
Note that, by contrast, command lines specified for use with npm run
inside package.json
files implicitly know about project-local CLIs, so that use of npx
isn't necessary there.