Ephapox
Ephapox

Reputation: 827

babel-cli issues with npm

I am using babel to build a part of my library and I'm running into issues when i run babel commands through npm.

I have an npm script called build that calls:

{
  "prebuild": "rm -rf && mkdir dist",
  "build": "babel src/index.js -o dist/index.js"
}

I have run the actual babel command itself in my command line and it works.

However when I do npm run build from my command line it says

The CLI has been moved into the package 'babel-cli'

npm also says that it is that specific line that is failing.

I have already tried the following:

  1. Restart my terminal.
  2. Install babel v5 because I read that v6 split a lot of its functionality.
  3. npm rebuild.
  4. Delete my node_modules and npm install

Any other ideas? as to why npm fails at running this command?

Upvotes: 0

Views: 272

Answers (1)

user4695271
user4695271

Reputation:

Install babel@5 globally (npm install babel@5 --global) as well as locally: npm install babel@5 --save-dev

Upvotes: 1

Related Questions