heimashi/easy_mock_api

请问这个怎么解?

hcjcch opened this issue · 2 comments

Error: Couldn't find preset "es2015" relative to directory "/Users/hcjcch"
at /Users/hcjcch/DEVELOP/GithubAndroidProjects/easy_mock_api/node_modules/babel-core/lib/transformation/file/options/option-manager.js:293:19
at Array.map (native)
at OptionManager.resolvePresets (/Users/hcjcch/DEVELOP/GithubAndroidProjects/easy_mock_api/node_modules/babel-core/lib/transformation/file/options/option-manager.js:275:20)
at OptionManager.mergePresets (/Users/hcjcch/DEVELOP/GithubAndroidProjects/easy_mock_api/node_modules/babel-core/lib/transformation/file/options/option-manager.js:264:10)
at OptionManager.mergeOptions (/Users/hcjcch/DEVELOP/GithubAndroidProjects/easy_mock_api/node_modules/babel-core/lib/transformation/file/options/option-manager.js:249:14)
at OptionManager.init (/Users/hcjcch/DEVELOP/GithubAndroidProjects/easy_mock_api/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
at compile (/Users/hcjcch/DEVELOP/GithubAndroidProjects/easy_mock_api/node_modules/babel-register/lib/node.js:103:45)
at loader (/Users/hcjcch/DEVELOP/GithubAndroidProjects/easy_mock_api/node_modules/babel-register/lib/node.js:144:14)
at Object.require.extensions.(anonymous function) [as .jsx] (/Users/hcjcch/DEVELOP/GithubAndroidProjects/easy_mock_api/node_modules/babel-register/lib/node.js:154:7)
at Module.load (module.js:458:32)

这个问题可能是node或npm的版本问题,可以通过增加.babelrc配置文件来修改这个找不到路径问题
{ "presets": [ ["es2015", { "modules": false }] ] }
我已在master分支上提交这个文件了,你pull更新一下代码试试

for those who still cannot work this out:

You only need to install babel-preset-es2015.

npm install babel-cli babel-preset-es2015