SkyPunch
SkyPunch

Reputation: 324

Cannot find module '@babel/runtime/core-js/object/create' Node js Express

I have an express project and its running perfectly on my local machine (Windows).

When i try to deploy it (on ubuntu), i am getting

Error: Cannot find module '@babel/runtime/core-js/object/create'
    at Function.Module._resolveFilename (module.js:548:15)
    at Function.Module._load (module.js:475:25)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/var/www/project/node_modules/xregexp/lib/xregexp.js:10:38)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/var/www/project/node_modules/xregexp/lib/index.js:10:39)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/var/www/project/controllers/script.js:3:15)
    at Module._compile (module.js:653:30)

I tried npm install babel-runtime --save but it didn't solve anything

Upvotes: 0

Views: 2067

Answers (1)

lvpro
lvpro

Reputation: 278

hit this issue this morning as well. Are you by chance using xregexp? If so, lock the version to 4.2.0 in your package.json by removing any leading carrot. "xregexp": "4.2.0"

https://github.com/slevithan/xregexp/issues/262

Update: Looks like they have fixed it in 4.2.3.

Upvotes: 1

Related Questions