I have been using handlebars.js client-side for a while, and I wanted to get into using pre-compiled templates. I followed the general instructions I could find on the web, including installing it on Node.js:
npm install handlebars -g
Next, I go to my Node.js directory and try to compile a simple template:
handlebars test.handlebars -f test.js
And I get an error (command prompt, mind you and i'm sorry):
C:\Users\Administrator\AppData\Roaming\npm\node_modules\handlebars\lib\handlebars.js:1
(function (exports, require, module, __filename, __dirname) { import Handlebar
^^^^^^
SyntaxError: Unexpected reserved word
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (C:\Users\Administrator\AppData\Roaming\npm\node_modules\handlebars\bin\handlebars:105:18)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
I go to this handlebars.js file that errored and sure enough the code definitely doesn't look like javascript:
import Handlebars from "./handlebars.runtime";
// Compiler imports
module AST from "./handlebars/compiler/ast";
import { parser as Parser, parse } from "./handlebars/compiler/base";
// ... etc.
I don't really know what this is, so I don't know what I did wrong or what my problem is.