Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting a syntax error while executing cml on CLI #960

Closed
abhishekPurandare-obs opened this issue Apr 13, 2022 · 8 comments · Fixed by #966
Closed

Getting a syntax error while executing cml on CLI #960

abhishekPurandare-obs opened this issue Apr 13, 2022 · 8 comments · Fixed by #966
Assignees
Labels
ci-bitbucket p0-critical Max priority (ASAP)

Comments

@abhishekPurandare-obs
Copy link

I installed CML using

sudo npm i -g @dvcorg/cml

but getting this error whenever I execute any CML commands.

>> cml ci --help
/usr/lib/node_modules/@dvcorg/cml/src/drivers/bitbucket_cloud.js:383
        responseBody?.error?.message || responseBody?.error || responseBody;
                     ^

SyntaxError: Unexpected token '.'
    at wrapSafe (internal/modules/cjs/loader.js:915:16)
    at Module._compile (internal/modules/cjs/loader.js:963:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/usr/lib/node_modules/@dvcorg/cml/src/cml.js:11:24)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)

Is there a proper way to test whether the installation has been done correctly?

@casperdcl casperdcl added p0-critical Max priority (ASAP) ci-bitbucket labels Apr 13, 2022
@0x2b3bfa0 0x2b3bfa0 self-assigned this Apr 13, 2022
@0x2b3bfa0
Copy link
Member

0x2b3bfa0 commented Apr 13, 2022

@abhishekPurandare-obs, please use Node.js 16+

For instance, you can set image to node:17-alpine or use our container images with CML installed; e.g. iterativeai/cml:0-dvc2-base1

@casperdcl
Copy link
Contributor

casperdcl commented Apr 13, 2022

Surely npm i should get an old v14-compatible version though? Or just not install at all if on node<14?

@dacbd
Copy link
Contributor

dacbd commented Apr 13, 2022

Surely npm i should get an old v14-compatible version though? Or just not install at all if on node<14?

cml/package.json

Lines 32 to 34 in 6fb4c10

"engines": {
"node": "<=16.x"
},

@dacbd
Copy link
Contributor

dacbd commented Apr 13, 2022

the optional chaining commit should have also expanded this to exclude older node versions I believe

@0x2b3bfa0
Copy link
Member

0x2b3bfa0 commented Apr 13, 2022

Yes, it should be {"node": ">=16.x"} probably. Alternatively, we may want to consider using Babel and transpiling our code; see #597 (comment). 🙈

@dacbd
Copy link
Contributor

dacbd commented Apr 13, 2022

perhaps a v0.14.2 with the correct engine semver and de-publish the 0.14.1 on npm so it's not accidentally downloaded on a <16.x node version?

@0x2b3bfa0
Copy link
Member

0x2b3bfa0 commented Apr 15, 2022

@abhishekPurandare-obs, “fixed” with v0.15.0, sorry for the inconvenience!

@abhishekPurandare-obs
Copy link
Author

Okay..Working after upgrade the nodejs version to v16.14.2. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-bitbucket p0-critical Max priority (ASAP)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants