npmでcoffee-scriptはハイフンなしのcoffeescriptパッケージに移動したらしいと聞いたけど
daabでセレクトスタンプの送信を行う検証用コードの
JavaScriptの書き方が分からなかったので、公式エディタで
サンプルコードそのままに実行してみたら、下記エラーが発生したので
[stdin]:40:4: error: mixed indentation
options: ["選択肢1","選択肢2","選択肢3"]
^
実行ログの最初に出る警告メッセージの内容を支持してローカルの
テスト開発環境で、ハイフンありのパッケージをアンインストールして、
ハイフンなしのパッケージをインストールしてみた。
ちなみに、最新のCoffeeScript2をインストールするには、
--save-devを使うらしい。
※多分、既存プロジェクトのコードはCoffee2には未対応だと思うから
書き換えないとエラーが発生すると思うけど・・・
その時点で差分あり過ぎるなw
もう少し、調べたほうがよいのかもしれない(ΦωΦ;)
[手順]
1. プロジェクトディレクトリのnode_modulesへ移動。
$ cd ~/node_modules
2. coffee-scriptパッケージをアンインストール。
$ npm uninstall coffee-script --save
- coffee-script@1.6.3 node_modules/coffee-script
3. coffeescriptパッケージをインストール。
$ npm install coffeescript --save
npm WARN deprecated coffee-script@1.6.3: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
starter@0.3.6 /home/username/mybot2
├── coffeescript@2.2.4
└─┬ lisb-hubot@2.19.2
└── coffee-script@1.6.3npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.0: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
4. daabを実行。
案の定エラーになってる。やっぱりcoffeescript2には未対応なのねw
あとで詳しく見ようw(ΦωΦ)
$ daab run
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.0: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN enoent ENOENT: no such file or directory, open '/home/username/mybot2/node_modules/storage.local/package.json'
/home/username/mybot2/node_modules/lisb-hubot/src/brain.coffee:10:5: error: Can't reference 'this' before calling super in derived class constructors
@data =
^
error: Forever detected script exited with code: 1
[参考サイト]
http://coffeescript.org/#installation