Luk*_*ett 2 sass node.js npm gulp visual-studio-2015
打开Visual Studio任务运行程序资源管理器时,gulpfile.js无法加载,并在"输出"窗口中发出此错误.
Failed to run "C:\DATA\Git\MyApp\MyBiz.MyApp\MyBiz.MyApp.WebsiteCore\Gulpfile.js"...
cmd.exe /c gulp --tasks-simple
C:\DATA\Git\MyApp\MyBiz.MyApp\MyBiz.MyApp.WebsiteCore\node_modules\node-sass\lib\binding.js:15
throw new Error(errors.missingBinary());
^
Error: Missing binding C:\DATA\Git\MyApp\MyBiz.MyApp\MyBiz.MyApp.WebsiteCore\node_modules\node-sass\vendor\win32-ia32-47\binding.node
Node Sass could not find a binding for your current environment: Windows 32-bit with Node.js 5.x
Found bindings for the following environments:
- Windows 64-bit with Node.js 6.x
This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass` to build the binding for your current environment.
at module.exports (C:\DATA\Git\MyApp\MyBiz.MyApp\MyBiz.MyApp.WebsiteCore\node_modules\node-sass\lib\binding.js:15:13)
at Object.<anonymous> (C:\DATA\Git\MyApp\MyBiz.MyApp\MyBiz.MyApp.WebsiteCore\node_modules\node-sass\lib\index.js:14:35)
at Module._compile (module.js:397:26)
at Object.Module._extensions..js (module.js:404:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (C:\DATA\Git\MyApp\MyBiz.MyApp\MyBiz.MyApp.WebsiteCore\node_modules\gulp-sass\index.js:187:21)
at Module._compile (module.js:397:26)
Run Code Online (Sandbox Code Playgroud)
跑步gulp运行任务,我的SASS编译正常.
我尝试重新安装节点,我还确保只有一个npmrunnable在Windows路径中,我已经删除了该node_modules文件夹并运行npm install了几次,也尝试过npm rebuild node-sass.
所有这些数以百万计的酷炫新的前端工具和库似乎都在极大地拓宽了"出问题"的表面,与以前的项目相比,它们的效率都不高.
卢克
配置VS以使用较新版本的节点.
查找Ryan Hayes在Synchronize Node.JS安装版本与Visual Studio 2015中的说明
如果链接过时,说明中的代码段如下.
我在Visual Studio之外更新了Node.JS,但由于VS使用自己独立于任何外部安装的安装,因此可能会遇到node_modules包依赖性问题,其中一个版本的npm安装了一个包(这使得它依赖于版本的Node/npm),然后您无法在其他版本中运行命令(它们会中断).具体来说,我遇到了node-sass和windows绑定的问题.解决方案是将Visual Studio指向我已经在Visual Studio外部设置的Node.JS版本.
- 首先,找到您已经拥有的Node.js安装并在命令行中使用.
我安装了nodejs C:\Program Files (x86)\nodejs\.
工具>选项>项目和解决方案> Web 包管理>外部 Web 工具> 将$(PATH)移到 $(VSInstalledExternalTools)上方。
| 归档时间: |
|
| 查看次数: |
1122 次 |
| 最近记录: |