我是靠谱客的博主 仁爱苗条,这篇文章主要介绍文件丢失造成 npm 报错 Module build failed: Error: No PostCSS Config found in:,现在分享给大家,希望可以做个参考。

VueDemo上传git,在clone一份下来或者复制一份报错
npm 报错 Module build failed: Error: No PostCSS Config found in:
原因:.postcssrc.js 文件丢失造成
解决方法:在根文件里面新建一个文件 .postcssrc.js 在里面添加以下代码:

// https://github.com/michael-ciniawsky/postcss-load-config

module.exports = {
“plugins”: {
“postcss-import”: {},
“postcss-url”: {},
// to edit target browsers: use “browserslist” field in package.json
“autoprefixer”: {
browsers: [‘Android >= 4.0’, ‘iOS >= 7’]
},
“postcss-pxtorem”: {
“rootValue”: 32,
“propList”: ["*"]
}
}
}

.babelrc文件丢失

{
    "plugins": [
        [
            "transform-runtime",
            {
                "polyfill": false
            }
        ]
    ],
    "presets": [
        [
            "env",
            {
                "modules": false
            }
        ],
        "stage-2",
    ]
}

完整目录结构

在这里插入图片描述

最后

以上就是仁爱苗条最近收集整理的关于文件丢失造成 npm 报错 Module build failed: Error: No PostCSS Config found in:的全部内容,更多相关文件丢失造成内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(116)

评论列表共有 0 条评论

立即
投稿
返回
顶部