Bench build error, babel-core module not found

Hi there,

i got an error running bench update in master branch:

module.js:471
    throw err;
    ^

Error: Cannot find module 'babel-core'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/frappe/frappe-bench/apps/frappe/frappe/build.js:3:15)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

Could you please double check?

Update:

installed new clean Ubuntu VM 16LTS, then run:

bench get-app erpnext https://github.com/frappe/erpnext

after cloning, it shows error:

module.js:471
    throw err;
    ^

Error: Cannot find module 'babel-core'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/frappe/frappe-bench/apps/frappe/frappe/build.js:3:15)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

then installing babel-core, it asks for less and other …installing all requested packages it rises error:

Error: Couldn't find preset "es2015" relative to directory "/home/frappe/frappe-bench/sites"
    at /home/frappe/frappe-bench/node_modules/babel-core/lib/transformation/file/options/option-manager.js:293:19
    at Array.map (native)
    at OptionManager.resolvePresets (/home/frappe/frappe-bench/node_modules/babel-core/lib/transformation/file/options/option-manager.js:275:20)
    at OptionManager.mergePresets (/home/frappe/frappe-bench/node_modules/babel-core/lib/transformation/file/options/option-manager.js:264:10)
    at OptionManager.mergeOptions (/home/frappe/frappe-bench/node_modules/babel-core/lib/transformation/file/options/option-manager.js:249:14)
    at OptionManager.init (/home/frappe/frappe-bench/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
    at File.initOptions (/home/frappe/frappe-bench/node_modules/babel-core/lib/transformation/file/index.js:212:65)
    at new File (/home/frappe/frappe-bench/node_modules/babel-core/lib/transformation/file/index.js:135:24)
    at Pipeline.transform (/home/frappe/frappe-bench/node_modules/babel-core/lib/transformation/pipeline.js:46:16)
    at babelify (/home/frappe/frappe-bench/apps/frappe/frappe/build.js:128:16)
Cannot babelify /home/frappe/frappe-bench/apps/frappe/frappe/public/js/frappe/form/script_manager.js
Error: Couldn't find preset "es2015" relative to directory "/home/frappe/frappe-bench/sites"
    at /home/frappe/frappe-bench/node_modules/babel-core/lib/transformation/file/options/option-manager.js:293:19

…and counting lines or error …

It’s really kind of frustrating … Can someone double check this?!

Thx

2 Likes

I can confirm this error. Have the same one on my Debian Jessie box.

I was able to fix this with

npm install babel-preset-es2015

This module was installed on another box where this error doesn’t occour.

1 Like

big thx, i’ll have a look!

Some how this file didn’t run when we install frappe: frappe/install_new_build_system_requirements.py at master · frappe/frappe · GitHub

I have to manual install those packages and it works again,

npm install babel-core less chokidar babel-preset-es2015 babel-preset-es2016 babel-preset-es2017 babel-preset-babili

5 Likes