12

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 @?

brouk.develop
  • 175
  • 1
  • 14

2 Answers2

9

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.

Jed Richards
  • 12,244
  • 3
  • 24
  • 35
  • Thank you very very much!!! I recently started study Thank you very much for your help!! – brouk.develop May 09 '19 at 11:41
  • I have changed from "babel-cli" to "@babel/cli" now getting error "babel-node": "babel-node --presets=flow" --- 'babel-node' is not recognized as an internal or external command. – Nadhas Aug 28 '19 at 04:51
  • 1
    Try installing `@babel/node` too – Jed Richards Aug 28 '19 at 08:29
  • I need help, so now how can I run my script from package.json? it's not working if use babel-cli, but when I use @babel/cli is not taking the --ignore argument. – AlfredoDaAs Jun 19 '20 at 02:03
0

if you want that your system recongnize the command babel-node you should install the dependency @babel/cli with the global scope:

npm install -g @babel/cli

Otherwise, you should invoque babel-node via npx: npx babel-node...

Tyler2P
  • 2,324
  • 26
  • 22
  • 31