从node6.x升级到node8.x会给出" node-saas"绑定错误

时间:2017-12-25 18:01:20

标签: node.js

在Windows 64位平台上,从Node6.x升级到Node8.x给出了以下内容

Error: Missing binding C:\bisbor1\src\main\webapp\node_modules\node-sass\vendor\win32-x64-57\binding.node
Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 8.x

它还要求构建必须安装Python的node-saas库。对于前端开发人员来说,安装Python来运行一个简单的" Hello Angular"似乎有点奇怪。应用程序。而且有趣的是,我甚至不需要节点saas。它不是我的应用程序的直接依赖。

2 个答案:

答案 0 :(得分:0)

在我安装Python以重新安装" node_modules"之后。好几次(更不用说"下载"互联网安装'要求),我终于通过以下解决方案找到了和平。

" 从git存储库下载相应的平台特定绑定文件(请注意抛出的错误中的绑定版本) https://github.com/sass/node-sass/releases

并在我的npm缓存中更新了node-sass绑定,该缓存位于C:\ Users \ bisbor1 \ AppData \ Roaming \ npm \ node_modules \ ng-packagr \ node_modules \ node-sass \ vendor \ win32- x64-57 "

答案 1 :(得分:0)

主要步骤是确保您已安装Python 2.7,因为在撰写本文时node-gyp仅支持python2。

要这样做:

  • 检查Python版本是否为2.7或更低版​​本using python --version
  • 使用sudo apt-get install python
  • 降级
  • 然后使用npm rebuild-node-sass重建node-sass

如果其他所有方法都正确,则npm start将启动您的应用。