为了账号安全,请及时绑定邮箱和手机立即绑定

Requiring external module babel-register

/ 猿问

Requiring external module babel-register

小角色Byme 2017-09-27 10:06:52

在搭建ES6环境的时候到最后一步gulp报错:

$ gulp --watch

[09:50:25] Requiring external module babel-register

C:\Users\jinxin\Desktop\es6\node_modules\_babel-core@6.26.0@babel-core\lib\transformation\file\options\option-manager.js:328

        throw e;

        ^


Error: Couldn't find preset "es2015" relative to directory "C:\\Users\\jinxin\\Desktop\\es6"

    at C:\Users\jinxin\Desktop\es6\node_modules\_babel-core@6.26.0@babel-core\lib\transformation\file\options\option-manager.js:293:19

    at Array.map (<anonymous>)

    at OptionManager.resolvePresets (C:\Users\jinxin\Desktop\es6\node_modules\_babel-core@6.26.0@babel-core\lib\transformation\file\options\option-manager.js:275:20)

    at OptionManager.mergePresets (C:\Users\jinxin\Desktop\es6\node_modules\_babel-core@6.26.0@babel-core\lib\transformation\file\options\option-manager.js:264:10)

    at OptionManager.mergeOptions (C:\Users\jinxin\Desktop\es6\node_modules\_babel-core@6.26.0@babel-core\lib\transformation\file\options\option-manager.js:249:14)

    at OptionManager.init (C:\Users\jinxin\Desktop\es6\node_modules\_babel-core@6.26.0@babel-core\lib\transformation\file\options\option-manager.js:368:12)

    at compile (C:\Users\jinxin\Desktop\es6\node_modules\_babel-register@6.26.0@babel-register\lib\node.js:103:45)

    at loader (C:\Users\jinxin\Desktop\es6\node_modules\_babel-register@6.26.0@babel-register\lib\node.js:144:14)

    at Object.require.extensions.(anonymous function) [as .js] (C:\Users\jinxin\Desktop\es6\node_modules\_babel-register@6.26.0@babel-register\lib\node.js:154:7)

    at Module.load (module.js:507:32)


查看完整描述

5 回答

?
慕尼黑318614
  • npm install babel-register?

查看完整回答
反对 回复 2019-08-16
?
huangche201314
同问。题主解决了没
查看完整回答
反对 回复 2018-04-28
?
无所谓_0001

同求~

查看完整回答
反对 回复 2018-04-20
?
云淡枫倾

你的这个问题解决了吗?怎么解决的

查看完整回答
反对 回复 2018-04-16
?
反对 回复 2017-09-27

添加回答

回复

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信