So I have taken the course code, and am in the process of using it to build a project of my own. Working on the premise that it will be better than I can write myself, at this time
However, I am currently getting the above issue, which I have tied down to the use of the import commands within /src/server.js
From what I have deduced it is related to a piece of functionality related to a babel dev dependency, something that would create .babelrc… I would prefer not to install every dev dependency without a broad understanding of what it does.
Babel is a toolchain that is mainly used to convert ECMAScript 2015+ code into a backward-compatible version of JavaScript in current and older browsers or environments.
Absolutely, you should not install anything that you don’t require in your project.
The babel plugin transforms ECMAScript modules to CommonJS, and hence it will transform the import syntax into require syntax under the hood.
I would suggest you to just spin up a new Node.js server from scratch, and once you are able to implement a very basic hello world function, you can start adding some dependencies like mongodb driver, express js router, and apparently, you’ll be able to figure out what other dependencies you need.
In case you have any doubts, please feel free to reach out to us.