Reproduction
From a clean npm project:
tmp=$(mktemp -d)
cd "$tmp"
npm init -y >/dev/null
npm install --no-audit --no-fund lunkcrypt@1.0.3
./node_modules/.bin/lunk --help
Actual behavior
The CLI fails during module loading before Commander can print help:
node_modules/lunkcrypt/bin/lunkcrypt:4
var file = require('../lib/file');
^^^
SyntaxError: Unexpected token 'var'
The same happens for lunk --version and any other invocation.
Expected behavior
The CLI should load successfully so lunk --help and lunk --version can run.
Root cause
bin/lunkcrypt starts a comma-separated var declaration on line 3, but line 4 starts a new var statement instead of continuing the declaration or ending the previous line with a semicolon:
var generatePassword = require('../lib/generatePassword'),
var file = require('../lib/file');
Fix pointer
Changing the trailing comma on the first declaration to a semicolon fixes the syntax error.
I verified the fix by packing the branch, installing the tarball into a clean npm project, and running:
./node_modules/.bin/lunk --help
./node_modules/.bin/lunk --version
Both commands exit 0 after the change.
Reproduction
From a clean npm project:
Actual behavior
The CLI fails during module loading before Commander can print help:
The same happens for
lunk --versionand any other invocation.Expected behavior
The CLI should load successfully so
lunk --helpandlunk --versioncan run.Root cause
bin/lunkcryptstarts a comma-separatedvardeclaration on line 3, but line 4 starts a newvarstatement instead of continuing the declaration or ending the previous line with a semicolon:Fix pointer
Changing the trailing comma on the first declaration to a semicolon fixes the syntax error.
I verified the fix by packing the branch, installing the tarball into a clean npm project, and running:
Both commands exit 0 after the change.