【问题标题】:WheneverIi run "npm start "in react i get Error: Cannot find module 'autoprefixer'每当我在反应中运行“npm start”时我得到错误:找不到模块'autoprefixer'
【发布时间】:2021-04-02 17:27:28
【问题描述】:

编译失败 ./src/index.css (./node_modules/css-loader/dist/cjs.js??ref--5-oneOf-4-1!./node_modules/postcss-loader/src??postcss!./src /index.css) 错误:找不到模块'autoprefixer'

【问题讨论】:

标签: javascript node.js reactjs react-router


【解决方案1】:
cd node_modeuls/postcss-loader // you need check the correct library name from the error
npm i autoprefixe
cd ../../
npm start

【讨论】:

  • 我尝试安装 autoprefix 但又遇到了一个新错误
  • ./src/index.css (./node_modules/css-loader/dist/cjs.js??ref--5-oneOf-4-1!./node_modules/postcss-loader/ src??postcss!./src/index.css) 错误:找不到模块'cssdb'
【解决方案2】:

尝试使用这种方法:

  • 删除node_modules 文件夹

  • 使用yarn 命令。或者如果你没有安装 Yarn,尝试先用npm install yarn 安装它,然后运行命令yarn 来安装你需要的包。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-01-27
    • 2021-09-11
    • 1970-01-01
    • 2023-02-13
    • 1970-01-01
    • 2021-09-04
    • 1970-01-01
    相关资源
    最近更新 更多