react模块有错误使用删除的Babel 5选项:base.optional

时间:2016-05-15 02:30:54

标签: reactjs webpack babel

对于node / webpack / babel / react来说,我是一个新手 - 而且它还有很高的攀登能力!

我非常接近让模块反应 - 网络图示例工作但不完全在那里。

这是我到目前为止的安装以及我在下面的错误。

node --version              v4.2.1
npm--version                2.14.7
made directory              react-network-diagrams
in that directory...
npm init
npm i webpack -S
npm i babel-loader babel-preset-es2015 babel-preset-react -S
vi .bablerc             -- { presets" : ["es2015", "react"] }
npm i react@^0.14.3 react-dom@^0.14.3 -S
npm install react-network-diagrams --save   -- ok this time
npm install         -- no errors
npm run start-website   -- error - not found
uploaded react-network-diagrams-master to same directory
webpack.examples.config.js -> webpack.config.js
npm run start-website → error :sh: 1: react-docgen: not found
npm i react-docgen --save       → ok
npm run start-website → error sh: 1: webpack-dev-server: not found
npm i webpack-dev-server --save     → ok

当我运行网站脚本时,我得到npm run start-website

> react-network-diagrams@0.6.0 start-website /home/ubuntu/react-network-diagram
> npm run docs && webpack-dev-server  --config webpack.examples.config.js


> react-network-diagrams@0.6.0 docs /home/ubuntu/react-network-diagram
> react-docgen src/ -x jsx -o examples/docs.json --pretty

http://localhost:8080/webpack-dev-server/
webpack result is served from /
content is served from /home/ubuntu/react-network-diagram
Hash: b9d3cb12fbebca77886e
Version: webpack 1.13.0
Time: 3413ms
             Asset     Size  Chunks             Chunk Names
examples-bundle.js  1.52 kB       0  [emitted]  app
chunk    {0} examples-bundle.js (app) 28 bytes [rendered]
    [0] multi app 28 bytes {0} [built] [1 error]

ERROR in ./examples/modules/main.jsx
Module build failed: ReferenceError: [BABEL] /home/ubuntu/react-network-diagram/examples/modules/main.jsx: Using removed Babel 5 option: base.optional - Put the specific transforms you want in the `plugins` option
    at Logger.error (/home/ubuntu/react-network-diagram/node_modules/babel-core/lib/transformation/file/logger.js:43:11)
    at OptionManager.mergeOptions (/home/ubuntu/react-network-diagram/node_modules/babel-core/lib/transformation/file/options/option-manager.js:305:20)
    at OptionManager.init (/home/ubuntu/react-network-diagram/node_modules/babel-core/lib/transformation/file/options/option-manager.js:506:10)
    at File.initOptions (/home/ubuntu/react-network-diagram/node_modules/babel-core/lib/transformation/file/index.js:243:89)
    at new File (/home/ubuntu/react-network-diagram/node_modules/babel-core/lib/transformation/file/index.js:159:72)
    at Pipeline.transform (/home/ubuntu/react-network-diagram/node_modules/babel-core/lib/transformation/pipeline.js:49:16)
    at transpile (/home/ubuntu/react-network-diagram/node_modules/babel-loader/index.js:14:22)
    at Object.module.exports (/home/ubuntu/react-network-diagram/node_modules/babel-loader/index.js:88:12)
 @ multi app
webpack: bundle is now VALID.

尽我所能,我不能完全看出我哪里出错了。

谢谢伊恩

0 个答案:

没有答案