postcss / postcss-cli

CLI for postcss
Other
824 stars 93 forks source link

Getting cannot use import statement outside a module #432

Closed abrarmadi closed 2 years ago

abrarmadi commented 2 years ago

I installed "autoprefixer" and "postcss-cli" packages and added this script

"prefix:css":"postcss --use autoprefixer -b 'last 10 versions' style/stylesheet.comp.css -o style/style.prefix.css" to the package.json, but when I am trying to run it, I am getting the following error

SyntaxError: Cannot use import statement outside a module at Module._compile (internal/modules/cjs/loader.js:895:18) at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10) at Module.load (internal/modules/cjs/loader.js:815:32) at Function.Module._load (internal/modules/cjs/loader.js:727:14) at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) at internal/main/run_main_module.js:17:11

how can I check that postcss-cli was not moved to ESM?

RyanZim commented 2 years ago

postcss-cli is written with ESM; please use Node 12+