Babel installation does not work through npm

I am trying to install ES6 through Babel following this guy , but I am getting an error from my terminal. This is what I see after installing npm install - global babel

/usr/local/bin/babel -> /usr/local/lib/node_modules/babel/cli.js
/usr/local/bin/babel-node -> /usr/local/lib/node_modules/babel/cli.js
/usr/local/bin/babel-external-helpers -> /usr/local/lib/node_modules/babel/cli.js
babel@6.5.2 /usr/local/lib/node_modules/babel

When I print babel-node

You have mistakenly installed the `babel` package, which is a no-op in Babel 6.
Babel CLI commands have been moved from the `babel` package to the `babel-cli` package.

    npm uninstall babel
    npm install babel-cli

See http://babeljs.io/docs/usage/cli/ for setup instructions.

I get the same answer as before when I try to run npm uninstall babel

+4
source share
3 answers

Use this.

npm install --global babel-cli

This installs it globally and works great. And check your .json package to see if babel-cli node is created under dev dependencies:

"devDependencies": {"babel-cli": "^6.14.0"}
+4
source

It is easy! you need babel path

for example

sudo ./node_modules/babel-cli/bin/babel.js --watch es6.js --out-file es5.js
+1

. babel, babel cli .

npm uninstall babel 
npm install --global babel-cli (this alone was   not enough) 
npm install babel-cli

.

0

All Articles