npm脚本中的Autoprefixer显示TypeError:模式必须是字符串或字符串数组 [英] Autoprefixer in npm script show TypeError: Patterns must be a string or an array of strings
本文介绍了npm脚本中的Autoprefixer显示TypeError:模式必须是字符串或字符串数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我运行npm run prefix:css时,它会显示
When I run npm run prefix:css it show the
TypeError:模式必须是字符串或数组字符串
{
"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"
}
}
这是我的packge.json文件
This is my packge.json file
错误图片是-
And the Error pic is -
我该如何解决?
推荐答案
prefix:css: postcss --use autoprefixer -b \最后10个版本\ css / style.comp .css -o css / style.prefix.css,
"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...
这篇关于npm脚本中的Autoprefixer显示TypeError:模式必须是字符串或字符串数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文