What is the difference between @babel/node
and babel-node
?
I did yarn add babel-node --dev
but I had error.
So I did yarn add @babel/node --dev
, it worked.
What is the meaning of @
?
Babel comes with a built-in CLI which can be used to compile files from the command line. In addition, various entry point scripts live in the top-level package at @babel/cli/bin . There is a shell-executable utility script, babel-external-helpers. js , and the main Babel cli script, babel.
You can also check the version of babel-cli by finding the babel-cli folder in node_modules and looking at the version property of the package. json that is at the base of that folder. If babel-cli was installed globally via -g flag of npm install , you could check the version by executing command babel --version .
Babel is a JavaScript compiler Babel is a toolchain that is mainly used to convert ECMAScript 2015+ code into a backwards compatible version of JavaScript in current and older browsers or environments.
If you've been active as a Node. js developer, or even dabbled in front-end libraries like React or Vue. js, then there's no doubt that you've likely run across Babel.
The @
signifies the usage of an "npm scope":
https://docs.npmjs.com/about-scopes
It's basically a way to avoid name clashing, so we could both own modules @cdbrouk/foo
and @jedrichards/foo
. Babel moved to using the @babel
scope a while ago, so the @babel/...
modules are the correct ones to use.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With