Autoprefixer in npm script show TypeError: Patterns must be a string or an array of strings

拈花ヽ惹草 提交于 2020-05-24 04:38:58

问题


When I run npm run prefix:css it show the

TypeError: Patterns must be a string or an array of strings

{
  "name": "natours",
  "version": "1.0.0",
  "description": "A natours project",
  "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"
   },
   "author": "Rahmat",
   "license": "ISC",
   "devDependencies": {
      "autoprefixer": "^9.6.1",
      "concat": "^1.0.3",
      "node-sass": "^4.12.0",
      "postcss-cli": "^6.1.3"
    }
   }

This is my packge.json file

And the Error pic is -

How can i solve it?


回答1:


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

i think you need to use string try with this...



来源:https://stackoverflow.com/questions/57122346/autoprefixer-in-npm-script-show-typeerror-patterns-must-be-a-string-or-an-array

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!