I got this error when tried to run my node server.js
/projects/my_project/angular/node_modules/ngx-bootstrap/modal/modal-backdrop.component.js:1
(function (exports, require, module, __filename, __dirname) { import { Component, ElementRef, Renderer2 } from '@angular/core';
^^^^^^
SyntaxError: Unexpected token import
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:616:28)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.IBu+ (/projects/my_project/angular/dist/dist-server/main.bundle.js:1:272046)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! demoapp@0.0.0 serve:universal: `npm run build:universal && cd dist && node server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the demoapp@0.0.0 serve:universal script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/hoangquan/.npm/_logs/2018-07-12T04_29_25_851Z-debug.log
It's seem node does not understand import command, right?
I'm using node version v8.11.3
I did use Babel to my project too, But It does'nt help. :(
Have you any suggestions? @m98 , thanks
I got this error when tried to run my node server.js
It's seem node does not understand
importcommand, right?I'm using node version
v8.11.3I did use
Babelto my project too, But It does'nt help. :(Have you any suggestions? @m98 , thanks