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

V2.* doesn't work with node 4.2.6 #425

Closed
wiewiur667 opened this issue Dec 15, 2023 · 5 comments · Fixed by #426
Closed

V2.* doesn't work with node 4.2.6 #425

wiewiur667 opened this issue Dec 15, 2023 · 5 comments · Fixed by #426
Labels
bug This issue is a bug. closing-soon This issue will automatically close in 4 days unless further comments are made. p3 This is a minor priority issue

Comments

@wiewiur667
Copy link

Describe the bug

I'm trying to run latest version of package using node 4.2.6(only available on target device)

When trying to run examples using nvm it fails, issue is that mqtt-packet is using classes and mqtt dependencies are using Buffer.from which is not available in that node version.

Downgrading mqtt to version 1.11.2 and websocket-stream to ^3.1.0 used in V1.* solves problem

Expected Behavior

Be able to use package in node 4.2.6

Current Behavior

root:/mnt/f/src/aws-iot-device-sdk-js# nvm exec 4.2 node ./examples/device-example.js
Running node v4.2.6 (npm v2.14.12)
/mnt/f/src/aws-iot-device-sdk-js/node_modules/mqtt-packet/parser.js:7
class Parser extends EventEmitter {
^^^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:374:25)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object. (/mnt/f/src/aws-iot-device-sdk-js/node_modules/mqtt-packet/mqtt.js:1:80)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)

Reproduction Steps

clone git repository
npm install
nvm exec 4.2 node ./examples/device-example.js

Possible Solution

Downgrade packages

Additional Information/Context

No response

SDK version used

2.2.13

Environment details (OS name and version, etc.)

Ubuntu WSL 22.04 - nvm with node 4.2.6

@wiewiur667 wiewiur667 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 15, 2023
@jmklix
Copy link
Member

jmklix commented Dec 16, 2023

Is there a specific reason why you can't update to a more recent version of node? Version 4.2.6 was last supported in 2018, so I would not recommended trying to use it. We can't guarantee that this sdk will work with such an old version of node. Please update your node version to a more recent one and let me know if you have any problems with the sdk.

@jmklix jmklix added closing-soon This issue will automatically close in 4 days unless further comments are made. p3 This is a minor priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Dec 16, 2023
@wiewiur667
Copy link
Author

Hi,

I can't update it as it's the only version Samsung SSSP4 SoC supports. I don't mind using v1.* as it works, but it's confusing that your package.json says that you support node 4.0.0.

Maybe you could bump up the engines version to avoid confusion in future.

@jmklix jmklix mentioned this issue Jan 3, 2024
@jmklix jmklix linked a pull request Jan 3, 2024 that will close this issue
@jmklix
Copy link
Member

jmklix commented Jan 8, 2024

I've tested this sdk with the older versions of node and 8.17 is the oldest release that works. I've also created a PR to update our documentation. Please let me know if this works for you and/or you have any other questions about this sdk.

Copy link

github-actions bot commented Jan 8, 2024

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@bretambrose
Copy link
Contributor

One other thing: I imagine if you look back in versions, you will eventually hit one that can be used with node 4. I'm pretty sure the version bump came about due to the need to update dependencies from a CVE perspective. In general, almost all of the CVE updates we've done don't represent an actual vulnerability while using the SDK, so if you're comfortable using an older version that will throw up a lot of npm audit warnings, that might be the right direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. closing-soon This issue will automatically close in 4 days unless further comments are made. p3 This is a minor priority issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants