BABEL:未知选项:base.Children [英] BABEL: Unknown option: base.Children

查看:460
本文介绍了BABEL:未知选项:base.Children的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚做了一个 npm更新,并获得了一些新的软件包版本。这打破了我的构建,使我无法使用 updateSchema.js blob / master / scripts / updateSchema.jsrel =noreferrer> https://github.com/relayjs/relay-starter-kit/blob/master/scripts/updateSchema.js

I just did a npm update and got some new package versions. This broke my build, leaving me unable to use the default updateSchema.js from https://github.com/relayjs/relay-starter-kit/blob/master/scripts/updateSchema.js.

如果任何人已经处理了这个问题,如果能够共享您的解决方案,将非常感激。

If anyone has already dealt with this issue, it would be greatly appreciated if you could share your solution.

我知道在新的Babel 6版本中删除了一些选项( https://gist.github.com/hzoo/7e78b12d99e326f2e04f )。 npm-debug.log文件如下所示:

I am aware that some options were removed in the new Babel 6 version (https://gist.github.com/hzoo/7e78b12d99e326f2e04f). The npm-debug.log file looks like this:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'update' ]
2 info using npm@2.14.12
3 info using node@v4.2.4
4 verbose run-script [ 'preupdate', 'update', 'postupdate' ]
5 info preupdate bifrost@1.0.0
6 info update bifrost@1.0.0
7 verbose unsafe-perm in lifecycle true
8 info bifrost@1.0.0 Failed to exec update script
9 verbose stack Error: bifrost@1.0.0 update: `babel-node ./scripts/helpers/updateSchema.js`
9 verbose stack Exit status 1
9 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:214:16)
9 verbose stack     at emitTwo (events.js:87:13)
9 verbose stack     at EventEmitter.emit (events.js:172:7)
9 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:24:14)
9 verbose stack     at emitTwo (events.js:87:13)
9 verbose stack     at ChildProcess.emit (events.js:172:7)
9 verbose stack     at maybeClose (internal/child_process.js:818:16)
9 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
10 verbose pkgid bifrost@1.0.0
11 verbose cwd C:\bifrostApp
12 error Windows_NT 10.0.10586
13 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "update"
14 error node v4.2.4
15 error npm  v2.14.12
16 error code ELIFECYCLE
17 error bifrost@1.0.0 update: `babel-node ./scripts/helpers/updateSchema.js`
17 error Exit status 1
18 error Failed at the bifrost@1.0.0 update script 'babel-node ./scripts/helpers/updateSchema.js'.
18 error This is most likely a problem with the bifrost package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error     babel-node ./scripts/helpers/updateSchema.js
18 error You can get their info via:
18 error     npm owner ls bifrost
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]

命令行错误如下所示: p>

The commandline error looks like this:

ReferenceError: [BABEL] C:\bifrostApp\scripts\helpers\updateSchema.js: Unknown option: base.Children. Check out http://babeljs.io/docs/usage/options/ for more info
at Logger.error (C:\bifrostApp\node_modules\babel-cli\node_modules\babel-core\lib\transformation\file\logger.js:39:11)
at OptionManager.mergeOptions (C:\bifrostApp\node_modules\babel-cli\node_modules\babel-core\lib\transformation\file\options\option-manager.js:267:20)
at OptionManager.init (C:\bifrostApp\node_modules\babel-cli\node_modules\babel-core\lib\transformation\file\options\option-manager.js:465:10)
at File.initOptions (C:\bifrostApp\node_modules\babel-cli\node_modules\babel-core\lib\transformation\file\index.js:194:75)
at new File (C:\bifrostApp\node_modules\babel-cli\node_modules\babel-core\lib\transformation\file\index.js:123:22)
at Pipeline.transform (C:\bifrostApp\node_modules\babel-cli\node_modules\babel-core\lib\transformation\pipeline.js:45:16)
at Object.transformFileSync (C:\bifrostApp\node_modules\babel-cli\node_modules\babel-core\lib\api\node.js:124:10)
at compile (C:\bifrostApp\node_modules\babel-cli\node_modules\babel-register\lib\node.js:98:20)
at loader (C:\bifrostApp\node_modules\babel-cli\node_modules\babel-register\lib\node.js:126:14)
at Object.require.extensions.(anonymous function) [as .js] (C:\bifrostApp\node_modules\babel-cli\node_modules\babel-register\lib\node.js:136:7)


推荐答案

确保您的 .babelrc 文件中列出的预设安装在您的 node_modules 文件夹中。

Make sure the presets listed in your .babelrc file are installed in your node_modules folder.

例如,如果您有以下内容您的.babelrc文件:

For example, if you have the following in your .babelrc file:

    {
      "presets": ["react", "es2015"]
    }

您将需要安装babel-preset-es2015和babel-preset-react与 npm install --save

You will need "babel-preset-es2015" and "babel-preset-react" installed with npm install --save.

这篇关于BABEL:未知选项:base.Children的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆