2
我試圖去安裝預編譯模板的句柄。我遵循安裝說明(http://handlebarsjs.com/precompilation.html),並且我似乎沒有任何問題運行安裝(見下文)。但是,當我發出編譯命令...使用Handlebars.compile時出現的問題
handlebars users.handlebars -f templates.js
無法找到handlebars命令。
-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
[email protected] /usr/local/share/npm/lib/node_modules/handlebars
├── [email protected]
└── [email protected] ([email protected])
(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
親愛的@Bill我有一個非常類似的問題。但我似乎無法找到正確的道路。我有'c:\ users \ b \ downloads \ node-v7.1.0-win-x64 \ node_modules'然後我有兩個可能的文件夾'handlebars'和'npm'。在裏面,我有'node_modules/.bin'的把手,但是裏面沒有'handlebars' ...有什麼幫助嗎?謝謝 –