当我将 grunt 与 PatternLab 结合使用时,找不到 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
使用 bundler 1.11.2
使用 scss-lint 0.33.0
捆绑完毕! 1 个 Gemfile 依赖项,现已安装 4 个 gem。
使用bundle show [gemname]
查看捆绑的 gem 的安装位置。
正在加载“sass.js”任务...错误
>> 错误:libsass
在/Users/my_user/Projects/my_app/src/global/pattern-lab/node_modules/node-sass/vendor/darwin-x64-46/binding.node 中找不到绑定(bind)
block 引用>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:关于以下行:“错误:在/Users/my_user/Projects/my_app/src/global/pattern-lab/node_modules/node-sass/vendor/darwin-x64-46/binding.node 中找不到
libsass
绑定(bind)”,供应商文件夹不存在。
最佳答案
我找到了修复方法,有必要在预期的位置添加正确的 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.
关于node.js - 使用 grunt 和 PatternLab 找不到任务 "sass",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34326516/