首页 文章

纱线安装,模块构建失败:错误:找不到预设“es2015”

提问于
浏览
0

我需要使用 react-selecthttps://github.com/JedWatson/react-select为此我需要先在 Ubuntu 14.04 上安装 yarn . 在安装之后, yarn add react-select 我无法使用 webpack 构建我的项目,因为它给了我错误:

./views/index.js中的错误模块构建失败:错误:无法找到相对于/ home / nikita目录“/ home / nikita / Desktop / kipnis_prototype / client_side_BrainImmuneConnectome / brain-immune-connectome”的预设“es2015” /Desktop/kipnis_prototype/client_side_BrainImmuneConnectome/brain-immune-connectome/node_modules/babel-core/lib/transformation/file/options/option-manager.js:293:19在OptionManager.resolvePresets(/ home /)的Array.map()处在OptionManager.mergePresets(/ home / nikita / Desktop /)上的nikita / Desktop / kipnis_prototype / client_side_BrainImmuneConnectome / brain-immune-connectome / node_modules / babel-core / lib / transformation / file / options / option-manager.js:275:20)在OptionManager.mergeOptions上的kipnis_prototype / client_side_BrainImmuneConnectome / brain-immune-connectome / node_modules / babel-core / lib / transformation / file / options / option-manager.js:264:10)(/ home / nikita / Desktop / kipnis_prototype / client_side_BrainImmuneConnectome /脑免疫连接组/ node_modules /巴贝尔核心/ lib中/变换/文件/选择离开/ option-manager.js:249:14)在OptionManager.init(/ home / nikita / Desktop / kipnis_prototype / client_side_BrainImmuneConnectome / brain-immune-connectome / node_modules / babel-core / lib / transformation / file / options / option- manager.js:368:12)在File.initOptions上(/home/nikita/Desktop/kipnis_prototype/client_side_BrainImmuneConnectome/brain-immune-connectome/node_modules/babel-core/lib/transformation/file/index.js:212:65)在Pipeline.transform(/ home / nikita)的新文件(/home/nikita/Desktop/kipnis_prototype/client_side_BrainImmuneConnectome/brain-immune-connectome/node_modules/babel-core/lib/transformation/file/index.js:135:24) /Desktop/kipnis_prototype/client_side_BrainImmuneConnectome/brain-immune-connectome/node_modules/babel-core/lib/transformation/pipeline.js:46:16)在transpile(/ home / nikita / Desktop / kipnis_prototype / client_side_BrainImmuneConnectome / brain-immune-connectome) /node_modules/babel-loader/lib/index.js:50:20)/ home / nikita / Desktop / kipnis_prototype / client_side_BrainImmuneConnectome /在ReadFileContext.callback(/ home / nikita / Desktop / kipnis_prototype / client_side_BrainImmuneConnectome / brain-immune-connectome / node_modules / babel-loader)中的brain-immune-connectome / node_modules / babel-loader / lib / fs-cache.js:118:18 /lib/fs-cache.js:31:21)在FSReqWrap.readFileAfterOpen [as oncomplete](fs.js:437:13)npm ERR!代码ELIFECYCLE npm ERR!错误2 npm ERR! brainimmuneconnectome@0.0.0 webpack:webpack npm ERR!退出状态2 npm ERR!错误的ERR!在brainimmuneconnectome@0.0.0 webpack脚本失败 . 错误的ERR!这可能不是npm的问题 . 上面可能有额外的日志记录输出 . 错误的ERR!可以在以下位置找到此运行的完整日志:npm ERR! /home/nikita/.npm/_logs/2018-06-07T04_11_30_458Z-debug.log

我在 .babelrc 文件中安装了礼物:

{
  "presets": ["es2015", "react", "stage-1"]
}

那么,我在这里找到的解决方案:

Error: Couldn't find preset "es2015" relative to directory

不工作 . 这里出了什么问题?怎么可能修好?

1 回答

相关问题