cfsghost / npk

Node.js packaging utility
137 stars 18 forks source link

windows下用 "爸爸認不得" --dad-doesnt-recognize 出現錯誤 #2

Closed shenqihui closed 9 years ago

shenqihui commented 10 years ago

windows 下面使用 --dad-doesnt-recognize 編譯npk工程裏面自帶的 purejs 項目,編譯時,出現這個錯誤,已經npmx下面安裝 node-gyp、compiler、npk,使用其他模式能打包成功,就這個模式沒打包成功,window下面支持這個模式的編譯不?看了下issue #1 中的,他能夠在osx和linux下面編譯,不知window下面可否。謝謝

錯誤提示如下: C:\Users\qihui>npk e://npk/tests/purejs/ --dad-doesnt-recognize

events.js:72 throw er; // Unhandled 'error' event ^ Error: spawn ENOENT at errnoException (child_process.js:980:11) at Process.ChildProcess._handle.onexit (child_process.js:771:34)

cfsghost commented 10 years ago

通常會這樣是因為找不到 node-gyp 這指令,你可能要先檢查一下。

shenqihui commented 10 years ago

貌似node-gyp配置那边还没弄好,window下面真麻烦,挑了好久,还在调试。

winddriver commented 10 years ago

我知道这是怎么回事,因为我也碰到这个问题了,我很确定不是因为node-gyp没配置好,因为我已经使用node-gyp编译过其他模块了都没问题。

这个问题是因为,npk生成的.cpp文件中把code直接简单粗暴的赋值给const char *code,c++里面对代码的行长度是有限制的,当代码过长时就会导致c++编译器报错。

我已经在mac下也测试过npk了,有同样的问题。

我测试的项目,压缩后的代码70多K,尝试手动修改生成的output.cpp,把const char code那段直接修改为: const char code = "(function() {})()"; 然后调用node-gyp configure, node-gyp build编译成功!

希望作者能尽快修正这个问题,谢谢。

cfsghost commented 9 years ago

此問題已經修正,請使用 v0.0.3 版。:-)