【问题标题】:Postcss-cli cannot find flexbugs-fixes module (finds autoprefixer with no problems though)Postcss-cli 找不到 flexbugs-fixes 模块(虽然找到 autoprefixer 没有问题)
【发布时间】:2016-11-16 04:29:08
【问题描述】:

我通过 npm 在我的项目中安装了 postcss-cli autoprefixer 和 postcss-flexbugs-fixes。 pff 有未满足的 dep 警告,但它确实安装了。我知道我的 postcss 和 cli 正在工作,因为当我运行时

postcss --use autoprefixer index.scss

从终端它工作得很好 - 我在那里有一些虚拟 css 只是为了排除语法错误。

当我跑步时

postcss --use postcss-flexbugs-fixes index.scss

我收到一条错误消息,提示找不到模块 postcss-flexbugs-fixes。可能值得一提的是,我在节点 4.4.5 上,但我之前在这个版本的节点上使用过 postcss-flexbugs-fixes,唯一的区别(包括版本号)是它被包装在一个 gulp 任务中。 这是完整的错误:

Error: Cannot find module 'postcss-flexbugs-fixes'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at /Users/ohu275/.nvm/versions/node/v4.4.5/lib/node_modules/postcss-cli/index.js:107:14
at Array.map (native)
at Object.<anonymous> (/Users/ohu275/.nvm/versions/node/v4.4.5/lib/node_modules/postcss-cli/index.js:100:24)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)

我最终试图通过一个 npm 构建脚本来运行我的 postcss 任务。我有 autoprefixer 工作,但没有通过 postcss-cli 使用 flexbugs-fixes 的骰子。我不得不认为我做错了什么,因为我之前已经使用过这个特定的插件,只是没有使用 cli。其他插件正在使用我的 cli。任何帮助将不胜感激。

【问题讨论】:

  • 你有npm install'd postcss-flexbugs-fixes,对吧?
  • 是的 - 我在本地安装了它。如果使用全局标志安装它会起作用,但这不是必需的,对吧?

标签: node.js node-sass postcss


【解决方案1】:
npm install -D postcss-flexbugs-fixes  

npm install -D postcss-preset-env   

【讨论】:

  • 就我而言,只需安装 postcss-flexbugs-fixes 即可解决问题
猜你喜欢
  • 1970-01-01
  • 2022-10-31
  • 2019-01-07
  • 2020-06-30
  • 2019-02-16
  • 2020-02-23
  • 1970-01-01
  • 1970-01-01
  • 2020-01-29
相关资源
最近更新 更多