Closed
Description
I ran into an issue today on my lab machine when trying to run the latest version of buckets-mdplacement
(a freshly made image).
/opt/smartdc/electric-boray/node_modules/imgapi-cli/node_modules/sdc-clients/node_modules/smartdc-auth/node_modules/http-signature/lib/utils.js:62
HEADER,
^
SyntaxError: Unexpected token ,
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> (/opt/smartdc/electric-boray/node_modules/imgapi-cli/node_modules/sdc-clients/node_modules/smartdc-auth/node_modules/http-signature/lib/parser.js:5:13)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
$ /opt/smartdc/electric-boray/build/node/bin/node -v
v0.10.48
The shorthand property setting is what caused the issue:
var cat = 'pumpkin';
var obj = { cat };
// obj => { cat: 'pumpkin' }
Judging by https://node.green/#ES2015-syntax-object-literal-extensions-shorthand-properties it looks like this shorthand syntax was added in node 4.9, and doesn't exist in 0.8 or 0.10.
This specific issue will be fixed in v1.3.1 of this module, but going forward there are some things we may want to consider. As @trentm mentioned in an email:
- add a Jenkinsfile a la https://github.com/joyent/node-sshpk/blob/master/Jenkinsfile that will run make check and make test against a few supported versions of node to ensure this doesn't happen again
- bump the "engines" up to node >= 0.10 (we don't need 0.8 support anymore)
Though bumping the engine would have to go to at least 4.9 if what I mentioned above is correct. Ensuring we run make check
on our changes in this repo should help identify this issue happening in the future as well.
Metadata
Metadata
Assignees
Labels
No labels