CNode

试着运行 CNodeJs for Ionic的源码,Error: spawn ENOENT错误求支招

问答
Llzxue发布于12 年前最后回复12 年前33 回复13700 浏览0 收藏

安装环境: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)

F
fjcgreat#1·12 年前

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

I
ilanceli#3·12 年前
引用 lzxue@fjcgreat sass安装过了

@lzxue

grunt serve -v

的错误信息贴下看看

I
ilanceli#4·12 年前
引用 lzxue@fjcgreat sass安装过了

@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');
L
lzxue#5·12 年前
引用 ilanceli@lzxue 找到了 https://github.com/diegonetto/generator ionic/issues/15 issuecomment 38075095

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

N
NexusLee#6·12 年前

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

L
lzxue#7·12 年前
I
ilanceli#8·12 年前
引用 lzxue@ilanceli 程序终于运行起来了,谢谢,我的一个网站也是基于cnode www.thinkgis.cn 也想要个移动版,以后有问题希望还能向你请教。

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

L
lzxue#9·12 年前
引用 ilanceli@lzxue 找到了 https://github.com/diegonetto/generator ionic/issues/15 issuecomment 38075095

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

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

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

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

K
kuake#11·12 年前

win7下一直没效果啊???

K
kuake#12·12 年前
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.
K
kuake#13·12 年前
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>
I
ilanceli#14·12 年前
引用 kuake

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

A
alsotang#15·12 年前

我还是那句话

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

I
ilanceli#16·12 年前
I
ilanceli#18·12 年前
引用 alsotang@ilanceli 针对 win 的吗

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

A
alsotang#19·12 年前
引用 ilanceli@alsotang 不是,部分坑不分平台 顺便解决win的 发自 CNodeJs ionic

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

A
alsotang#20·12 年前
引用 ilanceli@alsotang 不是,部分坑不分平台 顺便解决win的 发自 CNodeJs ionic

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

I
ilanceli#21·12 年前
引用 alsotang@ilanceli 话说,未读消息在哪里看? 发自 CNodeJs ionic

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

A
alsotang#24·12 年前
引用 ilanceli@alsotang 点你的用户名 进入个人信息页面

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

untitled1.png

A
alsotang#25·12 年前
引用 ilanceli@alsotang 另外最近在做push

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

I
ilanceli#26·12 年前
引用 alsotang@ilanceli 我觉得打开应用之后,可以试着去轮询这个接口啊。

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

A
alsotang#27·12 年前
引用 ilanceli@alsotang 恩 好。 现在只有切出后切回去取一次

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

I
ilanceli#28·12 年前
引用 alsotang@ilanceli 做 push 有点屌啊。对,单独一个菜单。先【消息】然后才【版块】

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

K
kuake#30·12 年前

以下是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.
K
kuake#31·12 年前

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

N
NexusLee#32·12 年前

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

L
lzxue#33·12 年前

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

参与回复
登录后即可参与回复。登录