Node Sass 缺少多个节点版本的绑定 [英] Node Sass missing binding for multiple node versions

查看:80
本文介绍了Node Sass 缺少多个节点版本的绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 nvm 在节点版本之间切换.

I am using nvm to switch between node versions.

我的 package.json:

My package.json:

<代码>脚本":{"dev": "rm -rf public/assets/*.hot-update.js && NODE_ENV=development webpack --env=dev --progress --profile --colors","prod": "NODE_ENV=production webpack --env=prod --progress --profile --colors"},作者": "","license": "ISC",开发依赖":{"babel-core": "^6.18.2","babel-loader": "^6.2.10","babel-preset-es2015": "^6.18.0","babel-preset-stage-0": "^6.16.0","babel-preset-stage-2": "^6.18.0","compression-webpack-plugin": "^0.3.2","css-loader": "^0.26.2","extract-text-webpack-plugin": "^2.0.0",文件加载器":v0.10.0","进口装载机": "^0.7.0","node-sass": "^4.1.1","postcss-cssnext": "^2.9.0","sass-loader": "^4.1.1","脚本加载器": "^0.7.0","style-loader": "^0.13.1","uglifyjs-webpack-plugin": "^0.1.2","vue": "^2.0.3","vue-lazyload": "0.7.5","vue-loader": "^10.2.1","vue-resource": "^1.2.0","vue-style-loader": "^1.0.0","vue-template-compiler": "^2.1.8","vuex": "^2.0.0","webpack": "2.2.0","webpack-manifest-plugin": "^1.1.0","webpack-md5-hash": "^0.0.5","webpack-merge": "^2.6.1","whatwg-fetch": "^2.0.2"}

当我使用 Node v6.2.0 并运行 npm run dev 时,出现以下错误:

When I am using Node v6.2.0, and run npm run dev, I get the following error:

ERROR in ./~/css-loader?{"minimize":true}!./~/vue-loader/lib/style-rewriter.js?id=data-v-be2abeee!./~/sass-loader!./~/vue-loader/lib/selector.js?type=styles&index=0!./~/@zoomcarindia/web-zap-revenue-calculator/src/components/graph/graph.vue
    Module build failed: Error: Missing binding /Users/nihar/Documents/zoomcar/web/node_modules/node-sass/vendor/darwin-x64-48/binding.node
    Node Sass could not find a binding for your current environment: OS X 64-bit with Node.js 6.x

Found bindings for the following environments:
  - OS X 64-bit with Node.js 7.x

当我使用 Node v7.8.0 时,出现以下错误:

and when I use Node v7.8.0, I get the following error:

ERROR in ./checklist/~/css-loader?{"minimize":true}!./~/vue-loader/lib/style-rewriter.js?id=data-v-a5234466!./checklist/~/sass-loader!./~/vue-loader/lib/selector.js?type=styles&index=0!./checklist/src/components/Upload.vue
    Module build failed: Error: Missing binding /Users/nihar/Documents/zoomcar/web/checklist/node_modules/node-sass/vendor/darwin-x64-51/binding.node
    Node Sass could not find a binding for your current environment: OS X 64-bit with Node.js 7.x

    Found bindings for the following environments:
      - Unknown environment (.DS_Store)
      - OS X 64-bit with Node.js 6.x

无论我使用哪个节点版本,它都表示缺少相应的绑定.

Whichever node version I use, it says the corresponding binding is missing.

我已经多次尝试 npm rebuild node-sassrm -rf node_modules.

I have tried npm rebuild node-sass and rm -rf node_modules multiple times.

甚至按照此处的建议尝试了 npm install --save-dev gulp-sass@2>.

最初我使用 brew 安装了节点.那是 v6.2.0.我按照此处的建议完全删除了 system 节点,然后使用 nvm 安装了相同的节点.

Initially I had installed node using brew. That was v6.2.0. I removed the system node completely as suggested here, and then installed the same using nvm.

但问题依然存在.请让我知道我在这里缺少什么.

But the issue still persists. Please let me know what I am missing here.

推荐答案

在与构建系统斗争数小时后,我放弃了,与上面的 Matt 类似,我只是从 https://github.com/sass/node-sass/releases

After hours of fighting build systems, I gave up and similar to Matt above, I just grabbed the binary from https://github.com/sass/node-sass/releases

(Matt 的链接没有到达节点 9)

(Matt's link did not go up to Node 9)

我创建了运行 webapp(在我的例子中是 Webstorm)的目录,它说它正在寻找丢失的二进制文件,下载了二进制文件,在我的例子中将 darwin-x64-59_binding.node 重命名为 binding.node 并尝试再次运行 -- 然后它起作用了.

I created the directory where the run webapp (in my case Webstorm) said it was looking for the missing binary, downloaded the binary and in my case renamed darwin-x64-59_binding.node to binding.node and tried running again -- it then worked.

这篇关于Node Sass 缺少多个节点版本的绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆