aichbauer / express-routes-mapper

a small mapper for express routes
MIT License
21 stars 16 forks source link

update babel to version 7 #21

Closed achmadk closed 6 years ago

achmadk commented 6 years ago

Hello, @aichbauer. This module is useful for me to create REST API back-end. Now, I am using babel version 7 in my project. I have used this package for mapping routes easily. Unfortunately, I have this error message after updating to babel version 7.

Error: Requires Babel "^7.0.0-0", but was loaded with "6.26.3". If you are sure you have a compatible version of @babel/core, it is likely that something in your build process is loading the wrong version. Inspect the stack trace of this error to look for the first entry that doesn't mention "@babel/core" or "babel-core" to see what is calling Babel.
    at throwVersionError (${MY_PROJECT_DIR}\node_modules\@babel\helper-plugin-utils\lib\index.js:65:11)
    at Object.assertVersion (${MY_PROJECT_DIR}\node_modules\@babel\helper-plugin-utils\lib\index.js:13:11)
    at api (${MY_PROJECT_DIR}\node_modules\@babel\plugin-proposal-function-sent\lib\index.js:51:7)
    at ${MY_PROJECT_DIR}\node_modules\@babel\helper-plugin-utils\lib\index.js:19:12
    at Function.memoisePluginContainer (${MY_PROJECT_DIR}\node_modules\babel-core\lib\transformation\file\options\option-manager.js:113:13)
    at Function.normalisePlugin (${MY_PROJECT_DIR}\node_modules\babel-core\lib\transformation\file\options\option-manager.js:146:32)
    at ${MY_PROJECT_DIR}\node_modules\babel-core\lib\transformation\file\options\option-manager.js:184:30
    at Array.map (<anonymous>)
    at Function.normalisePlugins (${MY_PROJECT_DIR}\node_modules\babel-core\lib\transformation\file\options\option-manager.js:158:20)
    at OptionManager.mergeOptions (${MY_PROJECT_DIR}\node_modules\babel-core\lib\transformation\file\options\option-manager.js:234:36)
    at OptionManager.init (${MY_PROJECT_DIR}\node_modules\babel-core\lib\transformation\file\options\option-manager.js:368:12)
    at compile (${MY_PROJECT_DIR}\node_modules\babel-register\lib\node.js:103:45)
    at loader (${MY_PROJECT_DIR}\node_modules\babel-register\lib\node.js:144:14)
    at Object.require.extensions.(anonymous function) [as .js] (${MY_PROJECT_DIR}\node_modules\babel-register\lib\node.js:154:7)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at ${MY_PROJECT_DIR}\node_modules\express-routes-mapper\lib\index.js:66:17
    at Array.forEach (<anonymous>)
    at mapRoutes (${MY_PROJECT_DIR}\node_modules\express-routes-mapper\lib\index.js:47:13)
    at Object.<anonymous> (${MY_PROJECT_DIR}\src\index.js:74:59)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Module._compile (${MY_PROJECT_DIR}\node_modules\pirates\lib\index.js:83:24)

Can I help you to upgrade this module using babel 7?

aichbauer commented 6 years ago

Hello @achmadk,

thank you for your issue.

I think updating the babel version in this package would do the trick.

Would you mind creating a Pull Request to fix this issue?

achmadk commented 6 years ago

I have created a pull request. According to travis CI review, express-routes-mapper cannot be used in node 4.

aichbauer commented 6 years ago

Thank you.

I will take a look into your PR this week. I think dropping node 4 would not be a problem, since the current stable is 10, and the maintenance for node 4 ended this year in April.