ソースファイルに依存関係が必要な場合は機能すると思いnpm install|update
ますが、実行可能ファイルを実行したい場合nodemon
は動作しないようです。ファイルをグローバルに検索しようとしていますか? これらのコマンドを最初に表示するにはどうすればよいnode_modules
ですか?
で開発サーバーを起動する Cakefile がありますnodemon
。例えば:
# **`procExec(procName)`**
# returns the path to executable in `node_`
procExec = (procName) ->
console.log "./node_modules/" + procName + "/bin/" + procName
"./node_modules/.bin/" + procName
# **`cake startdev`**
# Starts the server with `nodemon`
# Watch and compile `.coffee` and `.styl` files in `/client`
task "startdev", "Starts server with nodemon and watch files for changes", ->
# start nodemon server
nodemon = spawn procExec("nodemon"), ["server.coffee"]
processOutput nodemon
# watch and compile CoffeeScript
coffee = spawn procExec("coffee"), ["-o", "public/js/app", "-cw", "client/coffee"]
processOutput coffee
# watch and compile Stylus
stylus = spawn procExec("stylus"), ["client/stylus", "-l", "-w", "-o", "public/css/app"]
processOutput stylus
動作しますが、いくつかの小さな問題があります。
npm install|update
インストールしていないようですnodemon
。グローバルにインストールしようとして失敗したと思います。私は手動でnpm install nodemon
個別に行いました。どうしてこれなの?nodemon
とにかくインストールするように指示するにはどうすればよいですか?"./node_modules/.bin/" + procName
常に正しい実行可能ファイルに解決されますか?