Search code examples
cssnode.jsnpmsassnode-sass

Having trouble while running prefixer in npm


I am trying to run prefix CSS & I already have installed the prefixer npm package & postcss-cli package in the dev environment. While running the prefixer for my CSS file some errors are appearing. Here's the error log-

TypeError: Patterns must be a string or an array of strings
    at assertPatternsInput (E:\CODING GOOGLE DRIVE\CSS-SAAS\Natours\starter\node_modules\globby\index.js:16:9)
    at generateGlobTasks (E:\CODING GOOGLE DRIVE\CSS-SAAS\Natours\starter\node_modules\globby\index.js:41:2)
    at module.exports (E:\CODING GOOGLE DRIVE\CSS-SAAS\Natours\starter\node_modules\globby\index.js:115:20)
    at E:\CODING GOOGLE DRIVE\CSS-SAAS\Natours\starter\node_modules\postcss-cli\index.js:59:14
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] 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.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\isuro\AppData\Roaming\npm-cache\_logs\2020-08-22T04_51_28_876Z-debug.log

&here's the JSON file-

{
  "name": "isuro-portfolio",
  "version": "1.0.0",
  "description": "Landing Page For Isuro.tech",
  "main": "index.js",
  "scripts": {
    "watch:sass": "node-sass sass/main.scss css/style.css -w",
    "compile:sass": "node-sass sass/main.scss css/style.comp.css",
    "concat:css": "concat -o css/style.concat.css css/icon-font.css css/style.comp.css",
    "prefix:css": "postcss --use autoprefixer -b 'last 10 versions' css/style.concat.css -o css/style.prefix.css",
    "compress:css": ""
  },
  "author": "Surojit Manna",
  "license": "ISC",
  "devDependencies": {
    "autoprefixer": "^9.8.6",
    "concat": "^1.0.3",
    "node-sass": "^4.14.1",
    "postcss-cli": "^7.1.1"
  }
}

Unable to understand that what type of error I have made. I have also double-checked everything. Any help will be appreciated.


Solution

  • I feel here a single quote won't work we need to have a double quote, as mentioned in error. it worked for me!!

    try using

    "prefix:css": "postcss --use autoprefixer -b \"last 10 versions\" css/style.concat.css -o css/style.prefix.css"