8 ms·
> This isn't rocket science and honestly makes perfect sense. it only makes sense if you understand all the differences between ES modules and node modules tha
by throw_m239339 4y ago
> This isn't rocket science and honestly makes perfect sense.
it only makes sense if you understand all the differences between ES modules and node modules that exists purely for historical reasons. Node modules are not part of ES specification at first place.
- goldenkey 4y agoThe module stuff is a different story and that's its own rabbit hole. I don't think its the crux of the blog post or even my comment. The purported issue was that changing the package.json type to module didn't fix things. That expectation is beyond amateur and I don't think there's really anything to complain about if one expects to bootstrap into a new programming language with package management, without understanding the general paradigm.
- MaxLeiter 4y agoWell, they expected it because it's what node told them to do. from the article: John runs node index.js Node: Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.