使用Handlebars.compile的问题

我试图让把手安装预编译模板。 我按照安装说明(http://handlebarsjs.com/precompilation.html),我似乎没有任何问题运行安装(见下文)。 但是,当我发出编译命令…

handlebars users.handlebars -f templates.js 

无法findhandlebars命令。

 -bash: handlebars: command not found 

想知道这一个线索。

 (username) ~$ which npm /usr/local/bin/npm (username) ~$ which node /usr/local/bin/node (username) ~$ npm install -g handlebars npm http GET https://registry.npmjs.org/handlebars npm http 304 https://registry.npmjs.org/handlebars npm http GET https://registry.npmjs.org/uglify-js npm http GET https://registry.npmjs.org/optimist npm http 304 https://registry.npmjs.org/uglify-js npm http 304 https://registry.npmjs.org/optimist npm http GET https://registry.npmjs.org/wordwrap npm http 304 https://registry.npmjs.org/wordwrap /usr/local/share/npm/bin/handlebars -> /usr/local/share/npm/lib/node_modules/handlebars/bin/handlebars handlebars@1.0.7 /usr/local/share/npm/lib/node_modules/handlebars ├── uglify-js@1.2.6 └── optimist@0.3.4 (wordwrap@0.0.2) (username) ~$ cd Sites/projectone/templates/ (username) ~/Sites/projectone/templates (master)$ ll total 8 drwxr-xr-x 3 username ec_earth 102 Sep 26 23:57 . drwxr-xr-x 10 username ec_earth 340 Sep 26 23:58 .. -rw-r--r-- 1 username ec_earth 17 Sep 26 23:57 users.handlebars (username) ~/Sites/projectone/templates (master)$ handlebars users.handlebars -f templates.js -bash: handlebars: command not found 

       

网上收集的解决方案 "使用Handlebars.compile的问题"