Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Babel install does not work through npm

I'm trying to install ES6 through Babel by following this guy but I'm getting a mistake from my terminal. This is what I see after doing 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
[email protected] /usr/local/lib/node_modules/babel

When I type in babel-node

You have mistakenly installed the `babel` package, which is a no-op in Babel 6.
Babel's 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 response as before when I try npm uninstall babel

like image 266
akantoword Avatar asked Apr 15 '16 21:04

akantoword


1 Answers

Use this.

npm install --global babel-cli

This installs it globally and works perfectly. And check your package.json, whether babel-cli node is created under dev dependencies:

"devDependencies": {"babel-cli": "^6.14.0"}
like image 131
Linus Choudhury Avatar answered Sep 28 '22 08:09

Linus Choudhury