在Gatsby 2.17.6项目中,构建时:



这些是我的一些依赖项:

"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] /<app>/source
└─┬ [email protected]
  └─┬ [email protected]
    └─┬ [email protected]
      └─┬ [email protected]
        └── [email protected]

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

最佳答案

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

关于node.js - postcss-svgo : TypeError: Cannot set property 'multipassCount' of undefined (Gatsby),我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/58616161/

10-09 17:47