mxkraus
mxkraus

Reputation: 191

Babel installation - src doesnt exist

quick question. Found similar cases but they dont worked for me.

Following this guide https://babeljs.io/docs/setup/#installation I´m trying to install Babel Cli.

but running babel from a command in package.json configured like

"scripts": {
    "build": "babel src -d lib"
},

throwing an error

> babel src -d lib

src doesn't exist
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build: `babel src -d lib`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely 
additional logging output above.

npm ERR! A complete log of this run can be found in:

when running the command npm run build

I´ve already installed babel-preset-env and configured a .babelrc

npm version 6.1.0

Do you know where src doesn't exist comes from ? Thanks!

Upvotes: 6

Views: 8144

Answers (1)

Felix Kling
Felix Kling

Reputation: 816442

src is the folder that contains the files you want to transform. Either create it and move your files there or update the command to use the folder that contains your files.

More info: https://babeljs.io/docs/usage/cli/#compile-directories

Upvotes: 8

Related Questions