最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Babel installation - src doesnt exist - Stack Overflow

programmeradmin0浏览0评论

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

Following this guide I´m trying to install Babel Cli.

but running babel from a mand 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 plete log of this run can be found in:

when running the mand 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 es from ? Thanks!

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 mand 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 plete log of this run can be found in:

when running the mand 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 es from ? Thanks!

Share Improve this question edited May 31, 2018 at 22:35 Felix Kling 817k181 gold badges1.1k silver badges1.2k bronze badges asked May 31, 2018 at 19:46 mxkrausmxkraus 1911 silver badge11 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 8

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

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

发布评论

评论列表(0)

  1. 暂无评论