postcss-svgo:TypeError:无法设置未定义(Gatsby)的属性'multipassCount'

问题描述 投票:7回答:2

[在Gatsby 2.17.6项目上,构建时:

构建生产JavaScript和CSS包[====] 1.940 s 1/6 17%运行查询失败构建生产JavaScript和CSS包-75.519s

错误#98123 WEBPACK

生成JavaScript捆绑包失败

postcss-svgo:TypeError:无法设置属性'multipassCount'的未定义

未完成的运行查询-77.639s npm错误!代码ELIFECYCLE npm ERR!errno 1 npm错误! [email protected]构建:节点node_modules / gatsby / dist / bin / gatsby.js build` npm错误!退出状态1

这些是我的一些依赖项:

"dependencies": {
    "babel-plugin-styled-components": "^1.8.0",
    :
    "gatsby": "^2.0.19",
    "gatsby-plugin-favicon": "^3.1.4",
    "gatsby-plugin-google-fonts": "0.0.4",
    "gatsby-plugin-offline": "^2.0.5",
    "gatsby-plugin-react-helmet": "^3.0.0",
    "gatsby-plugin-styled-components": "^3.0.1",
    :
    "react": "^16.5.1",
    "react-dom": "^16.5.1",
    "react-helmet": "^5.2.0",
    "react-leaflet": "^2.1.1",
    "styled-components": "^4.1.1"
  }

我在gatsby-config.js上没有看到关于postcss的任何配置,我想这是Gatsby的默认行为。 npm ls postcss-svgo抛出此:

[email protected] /Users/martin/repos/asi-0028-amba_data/source
└─┬ [email protected]
  └─┬ [email protected]
    └─┬ [email protected]
      └─┬ [email protected]
        └── [email protected] 

如果解决方案,我不介意禁用postcss-svgo,但我不知道如何。

node.js webpack redhat gatsby postcss
2个回答
4
投票

我的项目已解决,请使用npm install [email protected] -E,详细信息请参见:https://github.com/svg/svgo/issues/1174


3
投票

"resolutions": { "svgo": "1.3.0" }

© www.soinside.com 2019 - 2024. All rights reserved.