question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Specify required nodejs version

See original GitHub issue

When running the echo.js demo I got the following exception

$ nodejs echo.js localhost 25565

.../node_modules/minecraft-protocol/dist/transforms/framing.js:112
          } else throw e;
                       ^
TypeError: Object REGISTER,UNREGISTER,MC|TrSel,MC|TrList has no method 'find'
    at Client.onCustomPayload (.../node_modules/minecraft-protocol/dist/client/pluginChannels.js:45:28)
    at Client.EventEmitter.emit (events.js:98:17)
    at Parser.<anonymous> (.../node_modules/minecraft-protocol/dist/client.js:101:16)
    at Parser.EventEmitter.emit (events.js:95:17)
    at readableAddChunk (.../node_modules/protodef/node_modules/readable-stream/lib/_stream_readable.js:217:18)
    at Parser.Readable.push (.../node_modules/protodef/node_modules/readable-stream/lib/_stream_readable.js:176:10)
    at Parser.Transform.push (.../node_modules/protodef/node_modules/readable-stream/lib/_stream_transform.js:123:32)
    at Parser._transform (.../node_modules/protodef/dist/serializer.js:88:14)
    at Parser.Transform._read (.../node_modules/protodef/node_modules/readable-stream/lib/_stream_transform.js:159:10)
    at Parser.Transform._write (.../node_modules/protodef/node_modules/readable-stream/lib/_stream_transform.js:147:83)

The code in question calls find on an channels which happens to be an array. Thus the desired function is Array.prototype.find, not available in my nodejs version.

Updating nodejs did solve the problem:

  • Version not working: v0.10.25
  • Version working: v4.2.6

Please specify the required nodejs version or use an ES6 shim in order to avoid such confusion 😃

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
roblablacommented, Dec 11, 2016

Currently, the tests are being run on nodejs 4 according to circle.yml.

I guess we could set engine-strict to whatever is the lowest we have in circle.yml.

0reactions
rom1504commented, Feb 26, 2017

the way we specify it is the correct way (https://docs.npmjs.com/files/package.json#engines) engineStrict is depreciated since npm 3

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I specify the required Node.js version in package.json?
I have a Node.js project that requires Node version 12 or higher. Is there a way to specify this in the packages.json file,...
Read more >
How to define the required Node.js version in package.json?
To define the required Node.js version in the package.json file we will have to go through few simple steps:.
Read more >
Specifying a required Node.js version in Package.json file
Specifying the Node version · Open the node project in your favorite code editor. · Navigate to the package.json file and add the...
Read more >
How to check minimum required Node.Js version - Medium
For many apps may be useful to check the Node. Js engine version and require specific version. We can use “engines” section in...
Read more >
How to specify the required Node.js and npm version in ...
In this tutorial we will learn how to lock the required Nodejs and npm version or rather specify the Nodejs and npm version...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found