试着运行 CNodeJs for Ionic的源码,Error: spawn ENOENT错误求支招
发布于 9 年前 作者 lzxue 12119 次浏览 最后一次编辑是 8 年前 来自 问答

安装环境:windows 7 64 位 试着运行 CNodeJs for Ionic的源码,运行中出现各种问题,出现各种问题,目前又一个问题求指点 @ilanceli 按照源码上的要求都环境都安装好了 ruby也安装了,在stackoverflow上也查到该问题http://stackoverflow.com/questions/26423705/what-causes-this-error-in-grunt-contrib-compass-after-update-to-yosemite但是未解决

运行 grunt serve 前面已经解决了好几个问题了,下面这个帮忙看一下:


报错

  grunt-contrib-compass/node_modules/tmp/lib/tmp.js:261
        throw err;
      ^
     Error: spawn ENOENT
    at errnoException (child_process.js:1001:11) 
   at Process.ChildProcess._handle.onexit (child_process.js:802:34)
33 回复

sass依赖于ruby,你先安装ruby,再安装sass。网上有教程,你自己查一下。 发自 CNodeJs ionic

@fjcgreat sass安装过了

@lzxue

grunt serve -v

的错误信息贴下看看

@lzxue 找到了

https://github.com/diegonetto/generator-ionic/issues/15#issuecomment-38075095

A solution would be to replace spawn by win-spawn:
1) npm install win-spawn
2) Replace the line in the Gruntfile.js:
var spawn = require('child_process').spawn;
by
var spawn = require('win-spawn');

@ilanceli 程序终于运行起来了,谢谢,我的一个网站也是基于cnode www.thinkgis.cn 也想要个移动版,以后有问题希望还能向你请教。

啊 竟然是做gis的o(≧v≦)o

@NexusLee 同行?

@lzxue 开发环境依赖比较多 解决了就好。 同样的api 改下css就可以有个可用的版本,哈哈。有问题随时问,相互学习。

@ilanceli 在问个可能比较low的问题,我在本地运行,取不到cnode的数据,还需要解决跨域问题,源码中数据访问没有跨域处理吗,对angularjs不熟,都不知道在哪里 去改。

@lzxue 跨域的问题见这里: https://github.com/lanceli/cnodejs-ionic/issues/1 为了方便开发 我通常是关闭chrome的web security,无所谓web server是否开启跨域 p.s. phonegap打包后的webview是可以跨域请求的 不需要web server开启跨域

稍微我后把这些问题整理到文档中

win7下一直没效果啊???

Done, without errors.
    Warning:
    C:\java\mygit\cnodejsIonic\node_modules\grunt-contrib-compass\node_modules\tmp\lib\tmp.js:261
      throw err;
            ^
    RangeError: Invalid array length
        at createBar (C:\java\mygit\cnodejsIonic\node_modules\time-grunt\time-grunt.js:105:14)
        at C:\java\mygit\cnodejsIonic\node_modules\time-grunt\time-grunt.js:116:53
        at Array.map (native)
        at formatTable (C:\java\mygit\cnodejsIonic\node_modules\time-grunt\time-grunt.js:109:38)
        at process.<anonymous> (C:\java\mygit\cnodejsIonic\node_modules\time-grunt\time-grunt.js:152:7)
        at process.g (events.js:180:16)
        at process.emit (events.js:95:17)
        at process.exit (C:\java\mygit\cnodejsIonic\node_modules\time-grunt\time-grunt.js:43:11)
        at tryToExit (C:\java\mygit\cnodejsIonic\node_modules\grunt\node_modules\exit\lib\exit.js:17:15)
        at C:\java\mygit\cnodejsIonic\node_modules\grunt\node_modules\exit\lib\exit.js:27:9 Use --force to continue.

    Aborted due to warnings.
Watching resources for changes.
Watching test for changes.
Watching www for changes.
    Warning:  Use --force to continue.

    Aborted due to warnings.


Execution Time (2015-01-22 09:28:18 UTC)
loading tasks                                                                         16ms  0%
serve                                                                                 16ms  0%
clean:dist                                                                            15ms  0%
clean:server                                                                           0ms  0%
ngconstant:development                                                                31ms  0%
wiredep:app                                                                          203ms  ■■■■■■■■■■■■■■■■ 2%
wiredep:sass                                                                          16ms  0%
concurrent:server                                                                     3.6s  ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 39%
autoprefixer:dist                                                                     31ms  0%
newer:copy:app                                                                       722ms  ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 8%
copy:app                                                                              2.5s  ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 27%
newer-postrun:copy:app:1:C:\java\mygit\cnodejsIonic\node_modules\grunt-newer\.cache    0ms  0%
newer:copy:tmp                                                                        31ms  0%
copy:tmp                                                                              16ms  0%
newer-postrun:copy:tmp:2:C:\java\mygit\cnodejsIonic\node_modules\grunt-newer\.cache    0ms  0%
concurrent:ionic                                                                        2s  ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 22%
Total 9.2s

C:\cnodejsIonic>

@kuake grunt serve -v 的结果贴下 只贴报错的部分就可以

我还是那句话

如果调试到最后,发现 bug 在于使用了 Windows 的话,眼中,会不会有泪光闪烁?

@alsotang ( ̄^ ̄) 我准备写份文档 从零开始搭建开发环境

@alsotang 不是,部分坑不分平台 顺便解决win的 发自 CNodeJs ionic

@ilanceli 话说,未读消息在哪里看? 发自 CNodeJs ionic

@ilanceli 我觉得放在左侧边栏的显眼靠上位置比较合理吧… 发自 CNodeJs ionic

@alsotang 点你的用户名 进入个人信息页面

@alsotang 单独一个菜单?

@alsotang 另外最近在做push

@ilanceli 我觉得打开应用之后,可以试着去轮询这个接口啊。

untitled1.png

@ilanceli 做 push 有点屌啊。对,单独一个菜单。先【消息】然后才【版块】

@alsotang 恩 好。 现在只有切出后切回去取一次

@ilanceli get /message/count 获取未读消息数 这个接口是幂等的,随便操 get /messages 获取已读和未读消息 这个则会【自动标记已读】,要谨慎操

@alsotang push 也没啥 就是现在插件不够完善 需要自己改造下

以下是grunt serve -v --force后的东西,最后在:Watching www for changes就挂起了

Watching app\templates\user.html for changes.
    Warning:  Use --force to continue.

    Aborted due to warnings.

Running tasks: ionic:serve

Running "ionic:serve" (ionic) task
Warning: undefined is not a function Use --force to continue.

Running "ionic:serve" (ionic) taskLoading "Gruntfile.js" tasks...
OKWarning: undefined is not a function Used --force, continuing.

@ilanceli 挂起之后8080 8010 9000 9002均无法访问

做过大半年 后来换工作了 没弄了

windows已成功运行起来,并编译了安卓版,ios版确实无能为力.

回到顶部