使用带有 PatternLab 的 grunt 找不到任务 "sass"

Task "sass" not found using grunt with PatternLab

当我在 PatternLab 中使用 grunt 时,找不到

Sass。

我有 Mac El Capitan,我认为 Node 和 Sass 设置正确,尽管我仍然不确定为什么它找不到 Sass。

我尝试安装另一个版本的 Node 和 Sass,但仍然是同样的错误。

有什么想法吗?

查看下面的 grunt 输出:


运行 "shell:patternlabStyles-rpm" (shell) 任务 npm WARN 已弃用 lodash@2.4.1:lodash@<3.0.0 不再维护。升级到 lodash@^3.0.0.

PatternLabStarter@2.4.0 postinstall /Users/my_user/Projects/my_app/src/global/pattern-lab find node_modules/ -name "*.info" -type f -delete

grunt-scss-lint@0.3.4 node_modules/grunt-scss-lint └── lodash@2.4.1 使用彩虹 2.0.0 使用 sass 3.4.5 使用捆绑器 1.11.2 使用 scss-lint 0.33.0 捆绑完成! 1 个 Gemfile 依赖项,现在安装了 4 gems。 使用 bundle show [gemname] 查看捆绑的 gem 的安装位置。 正在加载 "sass.js" 个任务...错误 >> 错误:在 /Users/my_user/Projects/my_app/src/global/pattern-lab/node_modules/node-sass/vendor/darwin-x64-46/binding.node

中找不到 libsass 绑定

This usually happens because your node version has changed. Run npm rebuild node-sass to build the binding for your current node version. Warning: Task "sass" not found. Use --force to continue.

由于警告而中止。


PS: 关于行:"Error: The libsass binding was not found in /Users/my_user/Projects/my_app/src/global/pattern-lab/node_modules/node-sass/vendor/darwin-x64-46/binding.node",供应商文件夹不存在。

我找到了修复,有必要在预期的位置添加正确的 node-sass 二进制文件。

解决方案已在 this post 中付诸实践。

So, manually created folder "darwin-x64-14". Then downloaded equivalent "binding.node" file from https://github.com/sass/node-sass-binaries/blob/master/darwin-x64-14_binding.node and copied the file to "darwin-x64-14" folder.