nodejs import is always undefined
nodejs import is always undefined It's my first time using Babel transpiler to write ES6 to create a nodejs program. I have the following directory structure: /src/ /modules/ commands.js index.js /app/ .babelrc package.json in my /src/index.js I import my commands.js file, and export a const test : /src/index.js commands.js const test import { commands as commandsModule } from './modules/commands'; export const test = 'some test'; Then, inside my /src/modules/commands/js , I try to do the following: /src/modules/commands/js import { test }from '../index'; console.log(test); Next, I use babel to transpile to es5 so I can run my program with node app/index.js using the following command: node app/index.js ./node_modules/.bin/babel ./src --experimental --source-maps-inline -d ./app && node ./app/index But this seems to always prints undefined! What am I doing wrong, I really don't understand why my imported test variable is undef...