Metor + 语义 UI :变量@googleProtocol未定义



我已经用 Meteor 创建了一个新项目,我正在尝试集成语义 UI,我已经完成了这里的步骤 https://semantic-ui.com/introduction/integrations.html 但是我在安装 sematicui 和 postcss 软件包后遇到了这个问题:

While processing files with less (for target web.browser):
client/lib/semantic-ui/definitions/globals/site.import.less:29: variable
@googleProtocol is undefined
error: variable @googleProtocol is undefined

Meteor 版本是 1.10.2,packages.json 看起来像这样;

{
"name": "test",
"private": true,
"scripts": {
"start": "meteor run",
"test": "meteor test --once --driver-package meteortesting:mocha"
},
"dependencies": {
"@babel/runtime": "^7.8.3",
"jquery": "^3.4.1",
"meteor-node-stubs": "^1.0.0"
},
"devDependencies": {
"autoprefixer": "^6.3.1",
"postcss": "^6.0.22",
"postcss-load-config": "^1.2.0"
},
"postcss": {
"plugins": {
"autoprefixer": {
"browsers": [
"last 2 versions"
]
}
}
}
}

我遇到了这个问题,这很痛苦。显然,问题在于与juliancwirko:postcss包和meteor(在我的情况下为2.0(的更少和一些不兼容的版本。我找到的解决方案如下:

  1. Meteor npm install --save-dev postcss@6.0.22 postcss-load-config@1.2.0
  2. npm install less@2.7.3 --save-dev

经过这些考虑,它终于奏效了。

同样的错误,对我来说,这有效:

meteor install semantic:ui
meteor install less@2.8.0

最新更新