internalBinding('errors').triggerUncaughtException( ^ Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'postcss'

1.8k Views Asked by At

Scss Postcss issues

Hi found an issue with the postcss compilation error whereby the devdepencies compute the prefix output of the perfix.css as below:

internal/process/esm_loader.js:74 internalBinding('errors').triggerUncaughtException(
^Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'postcss' imported from C:....s\node_modules\postcss-cli\index.js at packageResolve (internal/modules/esm/resolve.js:655:9) at moduleResolve (internal/modules/esm/resolve.js:696:18) at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:810:11) at Loader.resolve (internal/modules/esm/loader.js:86:40) at Loader.getModuleJob (internal/modules/esm/loader.js:230:28) at ModuleWrap. (internal/modules/esm/module_job.js:56:40) at link (internal/modules/esm/module_job.js:55:36) { code: 'ERR_MODULE_NOT_FOUND' } npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! -- prefix:css: postcss --use autoprefixer -b 'last 10 versions' css/style.concat.css -o css/style.prefix.css npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] prefix:css script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.`

1

There are 1 best solutions below

0
On

Anyway, I found a simple solution to the problem:

  1. Just update your node js to the latest version.
  2. Reinstall autoprefixer after updating your node js application {npm install autoprefixer --save-dev}
  3. Reinstall your postcss npm install postcss-cli --save-dev
  4. Okay you will be ready to compile your Scss code. Hopefully, you will not face any issues compiling your output.