问题
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