相关疑难解决方法(0)

如何覆盖嵌套的NPM依赖项版本?

我想使用grunt-contrib-jasmineNPM包.它有各种依赖.依赖图的一部分如下所示:

?? grunt-contrib-jasmine@0.4.1
 ? ??? grunt-lib-phantomjs@0.2.0
 ? ? ??? phantomjs@1.8.2-2
Run Code Online (Sandbox Code Playgroud)

不幸的是,这个版本中存在一个错误phantomjs,导致它无法在Mac OS X上正确安装.这在最新版本中已得到修复.

我怎样才能grunt-lib-phantomjs使用更新的版本phantomjs?

一些额外的背景:

node.js npm

257
推荐指数
7
解决办法
11万
查看次数

类型错误:match.loader.options.plugins 不是一个函数

我正在尝试在 ReactJS 应用程序中使用 tailwindCSS

package.json这些是文件中的脚本命令

  "scripts": {
    "start": "craco start",
    "build": "craco build",
    "test": "craco test",
    "eject": "react-scripts eject"
  }
Run Code Online (Sandbox Code Playgroud)

这是我的craco.config.js

module.exports = {
    style: {
        postcss: {
            plugins: [
                require('tailwindcss'),
                require('autoprefixer'),
            ],
        },
    },
}
Run Code Online (Sandbox Code Playgroud)

当我使用npm run start命令时,我遇到这个错误

TypeError: match.loader.options.plugins is not a function
    at extendsPostcss (C:\Development\Open Source\Learning Hub\react\node_modules\@craco\craco\lib\features\webpack\style\postcss.js:54:51)
    at overrideLoader (C:\Development\Open Source\Learning Hub\react\node_modules\@craco\craco\lib\features\webpack\style\postcss.js:97:9)
    at C:\Development\Open Source\Learning Hub\react\node_modules\@craco\craco\lib\features\webpack\style\postcss.js:118:13
    at Array.forEach (<anonymous>)
    at overridePostcss (C:\Development\Open Source\Learning Hub\react\node_modules\@craco\craco\lib\features\webpack\style\postcss.js:117:17)
    at overrideStyle (C:\Development\Open Source\Learning Hub\react\node_modules\@craco\craco\lib\features\webpack\style\style.js:9:25)
    at mergeWebpackConfig (C:\Development\Open Source\Learning …
Run Code Online (Sandbox Code Playgroud)

node.js reactjs craco

30
推荐指数
3
解决办法
2万
查看次数

标签 统计

node.js ×2

craco ×1

npm ×1

reactjs ×1