WebStorm 报错
发布于 7 年前 作者 mhu 10745 次浏览 来自 问答

WebStorm 的babel 模块错误如下:请教大神该如何解决

cmd.exe /D /C call D:/WX_XYX/node/node_global/babel.cmd game.js --out-dir dist --source-maps --presets env

Error: Couldn’t find preset “env” relative to directory “.”

    at D:\WX_XYX\node\node_global\node_modules\babel-cli\node_modules\[email protected]@babel-core\lib\transformation\file\options\option-manager.js:293:19

    at Array.map (<anonymous>)

    at OptionManager.resolvePresets (D:\WX_XYX\node\node_global\node_modules\babel-cli\node_modules\[email protected]@babel-core\lib\transformation\file\options\option-manager.js:275:20)

    at OptionManager.mergePresets (D:\WX_XYX\node\node_global\node_modules\babel-cli\node_modules\[email protected]@babel-core\lib\transformation\file\options\option-manager.js:264:10)

    at OptionManager.mergeOptions (D:\WX_XYX\node\node_global\node_modules\babel-cli\node_modules\[email protected]@babel-core\lib\transformation\file\options\option-manager.js:249:14)

    at OptionManager.init (D:\WX_XYX\node\node_global\node_modules\babel-cli\node_modules\[email protected]@babel-core\lib\transformation\file\options\option-manager.js:368:12)

    at File.initOptions (D:\WX_XYX\node\node_global\node_modules\babel-cli\node_modules\[email protected]@babel-core\lib\transformation\file\index.js:212:65)

    at new File (D:\WX_XYX\node\node_global\node_modules\babel-cli\node_modules\[email protected]@babel-core\lib\transformation\file\index.js:135:24)

    at Pipeline.transform (D:\WX_XYX\node\node_global\node_modules\babel-cli\node_modules\[email protected]@babel-core\lib\transformation\pipeline.js:46:16)

    at transform (D:\WX_XYX\node\node_global\node_modules\babel-cli\lib\babel\util.js:50:22)

Process finished with exit code 1

回到顶部