BeagleBone/BeagleBoard手动启动Cloud9开发环境


由于项目的缘故有机会接触到BeagleBone(我的是Rev5)的,说实话深深地被Cloud9和BoneScript这种开发方式震撼到。研究了几天稍稍的有点眉目了,下面就谈谈怎么手动的启动Cloud9开发环境吧。

一开始我是用ps -ef看到了启动Cloud9的命令,Bone101的也看得了,Cloud9用的是node4,而Bone101用的是node,不清楚它们之间有什么不同,试了一下用node启动Cloud9,失败了。


默认情况下Cloud9的端口为3000,Bone101的端口为80。

根据我看到的命令,我先把原来的Cloud9停止了,然后试着用命令

/usr/bin/node4 /usr/share/cloud9
来启动,但是失败了,错误信息如下:

   info  - socket.io started
uncaught exception:
Error
    at Object.<anonymous> (/usr/share/cloud9/support/jsdav/lib/DAV/exceptions.js:82:37)
    at Module.<anonymous> (module.js:411:26)
    at Module._compile (/usr/share/cloud9/support/requireJS-node.js:9:27)
    at Object..js (module.js:417:10)
    at Module.load (module.js:343:31)
    at Function._load (module.js:302:12)
    at require (module.js:355:19)
    at Object.<anonymous> (/usr/share/cloud9/support/jsdav/lib/DAV/server.js:14:14)
    at Module.<anonymous> (module.js:411:26)
    at Module._compile (/usr/share/cloud9/support/requireJS-node.js:9:27)

后来我又再试了一下

/usr/bin/node4 /usr/share/cloud9 --help
,得到如下的帮助信息:

Usage: /usr/bin/node4 /usr/share/cloud9 [options]
Show this help message
    --help
Load the configuration from a config file. Overrides command-line options. Default: <null>
    -c, --config <value>
Run child processes with a specific group. Default: <false>
    -g, --group <value>
Run child processes as a specific user. Default: <false>
    -u, --user <value>
Activate debug-mode. Default: <false>
    -d, --debug
Define an action to execute after the Cloud9 server is started. Default: <null>
    -a, --action <value>
IP address where Cloud9 will serve from. Default: <127.0.0.1>
    -l, --ip <value>
Port number where Cloud9 will serve from. Default: <3000>
    -p, --port <value>
Path to the workspace that will be loaded in Cloud9 (may be relative or absolute). Default: <.>
    -w, --workspace <value>

看了帮助就知道大致的启动命令了,指定一下端口、监听地址、工作目录就行了,使用命令
/usr/bin/node4 /usr/share/cloud9 -p 9112 -w /var/lib/cloud9 -l 0.0.0.0

,一定要监听0.0.0.0,否则的话你的电脑没法访问Cloud9,也必须指定一下工作目录,否则启动不成功。

之后一切正常了:

   info  - socket.io started


                         .  ..__%|iiiiiii=>,..
                          _<iIIviiiiiiiiiillli<_.
                       .ivIvilli%||+++++|iillllvs;_
                     ..nvlIlv|~`.......... -<*IIIvv=
                    .)nvvvvv-.... .   .. ...  ~nvvvo=.
         .__i<iiiii><vvvvn(= .  . ..i>, .  ... +)nnnv..
      _i%vvvvllIIlIlIvIvvv(   .. . lnnsi  .    :)vnvnsissvisi>__.
   .<vnvvvvvvIvvvvvvvlvvII;. .     |nnvv:  . . -)lvvlIIIIlvvIvnnns=_.
 .:vnvvvvvvvvvvvvvIvIvIIvv>:  . . . |{}l.    . :<lvIvvvvvvvvvvvvvvnov.
 |)nvnvnvnvnvnvvvvvvvvvvvvis .            . .  =ivvvvvvvvvvvnvnvnvnvnn..
.nnnnnnvnnvnvnvnvvvnvvvvvvvnv_   .    .       :vnvvvvvvvnvnnvnnnnnnnnov;
:2oonnnnnnnnnvnvnnvnvvnvvvvvIvvi==_i..    .  .vvvvvvvvnvnnvnnnnnnnnooooc
:nnooonnnnnnnnnnvvnvvvvvvvvIvIlIvvnI-      .=vvvvvvvvnvnvnnnnnnnnnnooo2(
 |{XooooonnnnnvnvnvvvvvvvIIIIIIIIv|-      .<vIlIIvIvvvvvnvvnvnnnnnooo2v(
 .){2ooooonnnnvnvnvvvvvIIIIIIlll+-     . =)lllIIvIvvvvvvvnvnnnvnnooo22-`
   -{2oooonnnnnvvvvvvvlIIlllllil==_   ._iIllillllllIvvvvvvnvnnnnoooo*-
  . -."11oonnvvvnvvIIlIlliliiiiillii||iliiiiiiililllIIvvvvvnnnnn2}(~.
      . -+~!lvvnvIvIIllliiiii|i|||i||i|||i||iiiiilillIIvvvvvv}|"- .
          . ..--~++++++++~+~+~+~+-+-+~+~+-+~+~++~++++++~~~-:.. .
               . .  . . .... . . .... .. ... .. ... . . . .

                           Ajax.org Cloud9 IDE
                              version 0.6
Project root is: /var/lib/cloud9
Point your browser to http://localhost:9112


你可能感兴趣的:(node.js,BeagleBone,Cloud9)