0

I am creating a node application which requires a local package es5_pkg (written in ES5).

es5_pkg is a separate project which i need to include in my node application and This is using babel transpiler.

I am getting error

import _ from 'lodash'; SyntaxError: Unexpected reserved word

Don't know what to do with. Not able to resolve this issue. Help me resolve this.

node application index.js

var npmPackage = require('es5_pkg'); // This package is in ES5

package.json

"dependencies": {
  "es5_pkg": "file:../es5_pkg"
 },
Anuj
  • 1,627
  • 2
  • 16
  • 27
  • I believe you need to transpile (e.g. using babel or similar) if you're using `import` since it is not supported natively by node yet. – mscdex Aug 10 '16 at 09:21
  • Updated the question. Can you please suggest something which is helpful – Anuj Aug 10 '16 at 09:30

1 Answers1

0

Have you tried searching for other questions/answers? Sounds like your babel is not setup correctly.

Perhaps this will help:

Unexpected reserved word 'import' when using babel

Community
  • 1
  • 1
alturium
  • 421
  • 5
  • 13