Comments (15)
你这个问题问得好,或许你还不知道我们在解决这个问题上的辛酸
from weflow.
对于 原生模块(c++) ,需要用 Electron 提供的头文件重新编译,如何编译看这里: http://electron.atom.io/docs/tutorial/using-native-node-modules/
然而, node-sass 并没法按这种正规的方式来重新编译,过程就不说了,多少辛酸多少泪,直接给你结果吧:
from weflow.
赞!测试了一下,重新编译依赖的win环境较为复杂,mac下重新编译的话木有问题。
from weflow.
mac 只占用整个开发时间的百分之三十,大部分时间都在跟 windows 做斗争
from weflow.
请问一下,对于node-sass的window重新编译问题,根据 sass/node-sass#1047 (comment) 在win7系统下重新编译成功后,切换不同的node版本进行 npm start 测试还是会提示环境错误。
from weflow.
编译都是跟具体的 node 版本有关的,
from weflow.
@littledu 我现在也是碰到这个问题,在win10下开发electron应用碰到require("node-sass")报错了,需要重新编译electron版本的node-sass,捣鼓了好久,但是环境依赖各种蛋疼都快崩溃了。想问下,可否把你编译好的node-sass模块打包发给我,我能直接用吗?
from weflow.
32位 : http://o92gtaqgp.bkt.clouddn.com/win32-ia32-47/binding.node
64 位:http://o92gtaqgp.bkt.clouddn.com/win32-x64-47/binding.node
替换掉 node-sass
下面的 vendor
对应的 binding.node 文件。
这里有我搞的一个项目,专门为 electron 编译,可以看看:
https://github.com/littledu/node-sass-prebuild-for-electron
from weflow.
我这个是 node 5.10.0 版本,对应 electron 的版本是 0.37.8,暂时还没时间去升级,如果你不是这些版本,就 fork 一下 https://github.com/littledu/node-sass-prebuild-for-electron ,改一下里面的 appveyor.yml 文件的 node 配置,或者你是哪个版本我来改一下帮你编译一份。
from weflow.
@littledu
上面两个都试了,替换掉还是报错了:
ELECTRON_ASAR.js:158 Uncaught Error: %1 is not a valid Win32 application.
?\E:\work\electronPrj\nss2\node_modules\node-sass\vendor\win32-x64-48\binding.node
我克隆clone了node-sass-prebuild-for-electron 到本地修改了配置,编译出错了。我的node是6.3.0,electron是1.2.5的,方便的话,帮我编译一份吧,3Q
from weflow.
@Shaman05
试试这个:http://o92gtaqgp.bkt.clouddn.com/win32-x64-48/binding.node
from weflow.
谢谢! 替换后报了下面的错误了
ELECTRON_ASAR.js:158 Uncaught Error: Module version mismatch. Expected 48, got 47.
The major version of node used to build the addon is a different major version of node you're using the addon with.
网上查了下,我的理解是指编译node-sass环境的node版本和使用node-sass的electron用的node环境不一致吧,不知是否正确。
如果是这样的话,我用代码
var message = [
Node 版本: ${process.versions.node}
,
Chrome 版本: ${process.versions.chrome}
,
Electron 版本: ${process.versions.electron}
,
System: ${config.osType} / ${config.osPlatform}
,
${config.title} 版本: ${config.version}
,
Author: ${config.author} <${config.github}>
];
得到的node版本是6.1.0,上面的6.3.0是我本机的node环境,能帮我用6.1.0再编译一份吗?谢谢
from weflow.
http://o92gtaqgp.bkt.clouddn.com/win32-x64-48/binding.node?v=1234
electron: 1.2.5
node: 6.1.0
记得下载链接后面的时间缀不要去掉,七牛有缓存,所以得加时间缀以免下载到旧版
from weflow.
@littledu
OK 3q
from weflow.
node-sass:-(
from weflow.
Related Issues (20)
- 编译如何避免将js切换成严格模式? HOT 2
- 字体库无法引入 HOT 2
- liveReload开启了,修改了css中的属性,但是并未生成 HOT 2
- 两个移动端疑问 HOT 6
- 运行flexbox 编译不下去 去掉就可以了 HOT 1
- 编译reversion时报错 HOT 1
- 文件路径匹配的 ! 不起作用 HOT 2
- 下载报错 HOT 2
- 官网无法访问 HOT 1
- macOS重装weflow之后无法导入项目 HOT 1
- REM配置了无效 HOT 1
- weflow 打包输出目录,能否去除html/ 这一层目录 HOT 1
- 官网的下载和查看demo页面报错 HOT 1
- weflwo都需求环境?除了nodejs 很多功能有问题,是不是我的环境缺少?比如ftp功能老报错internal/util.js:32 Ftp.raw[mkd](args): Use Ftp.raw('mkd args') instead HOT 2
- 需要什么运行环境? HOT 1
- ftp 上传不成功 HOT 2
- 官网无法下载 HOT 1
- slice文件夹 HOT 1
- change lang opt ? ;"(
- Hii HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from weflow.