Getting cannot use import statement outside a module while running npm script

Viewed 107

I am using npm and installed "autoprefixer" package 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

getting this 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

1 Answers
Related