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.

A GIF or MEME to give some spice of the internet

What is wrong?

Running examples generates a warning, my guess is that node 13 wants to go strict on differentiating cjs and mjs modules.

Terminal dump:

node:37516) Warning: require() of ES modules is not supported.
require() of /Users/vicary/Desktop/node-test/node_modules/brain.js/src/index.js from /Users/vicary/Desktop/node-test/brain.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /Users/vicary/Desktop/node-test/node_modules/brain.js/package.json.

Where does it happen?

Wherever it runs reuqire("brain.js")

How do we replicate the issue?

Just run the examples with the latest node version.

How important is this (1-5)?

4?

Expected behavior (i.e. solution)

No warnings are generated when an example is run.

Other Comments

Falling back to node LTE (12.13.0) removes the warning.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mubaidrcommented, Nov 18, 2019

Updated to support node 13, should be working fine now: https://github.com/BrainJS/brain.js/commit/c85cc6a7fad3d79b259bfc9f3c5cf770d28e40da

0reactions
mubaidrcommented, Feb 17, 2020

Latest alpha versions have this option fixed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Node.js - endoflife.date
Release Released Active Support 19 2 months and 6 days ago. (18 Oct 2022) Ends in 3 months and 1 week. (01 Apr 2... 18...
Read more >
"npm does not support Node.js v13.0.0" · Issue #30066 - GitHub
mgol commented on Oct 22, 2019. I installed Node using nvm if that matters: nvm install 13 ...
Read more >
npm does not support Node.js v13.14.0 - Stack Overflow
I try to make upgrade for Last version of the nodejs but I have windows 7 and said me that can not support...
Read more >
Node v13.13.0 (Current)
Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine.
Read more >
Node.js ES2015/ES6, ES2016 and ES2017 support
Yes. Yes Yes. Yes Error. Error Error. Error Error. Error Error. Error function() function() function() function() function() function() function() function() function() function() function() function() function() function()...
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