Skip to content

Unexpected token import #33

@tbiinfotech

Description

@tbiinfotech

I am getting following error:
import { Injectable } 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:607:28)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at Object.rgzQ (D:\yelo\dist\dist-server\main.bundle.js:1:620514)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! website@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 website@0.0.0 serve:universal script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

ng -v command is :
Angular CLI: 1.6.0
Node: 8.9.4
OS: win32 x64
Angular: 5.1.0
... animations, common, compiler, compiler-cli, core, forms
... http, platform-browser, platform-browser-dynamic
... platform-server, router

@angular/cli: 1.6.0
@angular/language-service: 4.4.6
@angular-devkit/build-optimizer: 0.0.35
@angular-devkit/core: 0.0.22
@angular-devkit/schematics: 0.0.41
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.0
@schematics/angular: 0.1.10
@schematics/schematics: 0.0.10
typescript: 2.4.2
webpack: 3.10.0

Can anyone suggest what should I change to remove the error?
Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions