angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Facing this issue while running ng serve "core_1.Version is not a function"

Open abhinaypandey opened this issue 9 years ago • 7 comments

Please provide us with the following information:

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.

The log given by the failure.

Normally this include a stack trace and some more information.

Mention any other details that might be useful.


Thanks! We'll be in touch soon.

abhinaypandey avatar Dec 21 '16 06:12 abhinaypandey

Here is the cmd log after running ng serve

core_1.Version is not a function TypeError: core_1.Version is not a function at Object. (E:\kronos-timesheet\kronos-timesheet-front\node_modules@angular\compiler-cli\src\version.js:18:19) at Module._compile (module.js:409:26) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at Object. (E:\kronos-timesheet\kronos-timesheet-front\node_modules@angular\compiler-cli\index.js:24:17) at Module._compile (module.js:409:26) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at Object. (E:\kronos-timesheet\kronos-timesheet-front\node_modules@ngtools\webpack\src\plugin.js:6:18) at Module._compile (module.js:409:26) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at Object. (E:\kronos-timesheet\kronos-timesheet-front\node_modules@ngtools\webpack\src\index.js:6:10) at Module._compile (module.js:409:26) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at Object. (E:\kronos-timesheet\kronos-timesheet-front\node_modules\angular-cli\models\webpack-build-typescript.js:5:17) at Module._compile (module.js:409:26) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at Object. (E:\kronos-timesheet\kronos-timesheet-front\node_modules\angular-cli\models\webpack-config.js:2:34) at Module._compile (module.js:409:26) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at Object. (E:\kronos-timesheet\kronos-timesheet-front\node_modules\angular-cli\tasks\build-webpack.js:6:24) at Module._compile (module.js:409:26) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at Object. (E:\kronos-timesheet\kronos-timesheet-front\node_modules\angular-cli\commands\build.js:3:23) at Module._compile (module.js:409:26) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at Class.module.exports.includedCommands (E:\kronos-timesheet\kronos-timesheet-front\node_modules\angular-cli\addon\index.js:21:16) at E:\kronos-timesheet\kronos-timesheet-front\node_modules\angular-cli\lib\models\project.js:392:61 at Array.forEach (native) at Project.addonCommands (E:\kronos-timesheet\kronos-timesheet-front\node_modules\angular-cli\lib\models\project.js:391:15) at Project.eachAddonCommand (E:\kronos-timesheet\kronos-timesheet-front\node_modules\angular-cli\lib\models\project.js:426:30) at module.exports (E:\kronos-timesheet\kronos-timesheet-front\node_modules\angular-cli\lib\cli\lookup-command.js:33:13) at CLI. (E:\kronos-timesheet\kronos-timesheet-front\node_modules\angular-cli\lib\cli\cli.js:34:26) at tryCatch (E:\kronos-timesheet\kronos-timesheet-front\node_modules\rsvp\dist\rsvp.js:538:12) at invokeCallback (E:\kronos-timesheet\kronos-timesheet-front\node_modules\rsvp\dist\rsvp.js:553:13) at publish (E:\kronos-timesheet\kronos-timesheet-front\node_modules\rsvp\dist\rsvp.js:521:7) at flush (E:\kronos-timesheet\kronos-timesheet-front\node_modules\rsvp\dist\rsvp.js:2373:5) at nextTickCallbackWith0Args (node.js:420:9) at process._tickCallback (node.js:349:13)

abhinaypandey avatar Dec 21 '16 06:12 abhinaypandey

Lock your @angular packages to "2.3.1"

scttcper avatar Dec 21 '16 06:12 scttcper

did that but after that getting Unmet peer dependency issues

+-- UNMET PEER DEPENDENCY @angular/[email protected] +-- @angular/[email protected] +-- UNMET PEER DEPENDENCY @angular/[email protected] +-- @angular/[email protected] +-- UNMET PEER DEPENDENCY @angular/[email protected] +-- @angular/[email protected] +-- [email protected] | +-- @angular/[email protected] | +-- @angular/[email protected] | +-- UNMET PEER DEPENDENCY @angular/[email protected] | +-- UNMET PEER DEPENDENCY @angular/[email protected] | -- @angular/[email protected] +-- UNMET PEER DEPENDENCY [email protected] -- UNMET PEER DEPENDENCY [email protected]

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm WARN @angular/[email protected] requires a peer of [email protected] but none was installed. npm WARN @angular/[email protected] requires a peer of zone.js@^0.7.2 but none was installed. npm WARN @angular/[email protected] requires a peer of [email protected] but none was installed. npm WARN @angular/[email protected] requires a peer of @angular/[email protected] but none was installed. npm WARN @angular/[email protected] requires a peer of @angular/[email protected] but none was installed. npm WARN @angular/[email protected] requires a peer of @angular/[email protected] but none was installed. npm WARN @ngtools/[email protected] requires a peer of @angular/[email protected] but none was installed. npm WARN @ngtools/[email protected] requires a peer of @angular/[email protected] but none was installed. npm WARN [email protected] requires a peer of @angular/core@~2.0.0 but none was installed. npm WARN [email protected] requires a peer of @angular/common@~2.0.0 but none was installed. npm WARN [email protected] requires a peer of @angular/compiler@~2.0.0 but none was installed. npm WARN [email protected] requires a peer of @angular/platform-browser@~2.0.0 but none was installed. npm WARN [email protected] requires a peer of @angular/http@~2.0.0 but none was installed.

abhinaypandey avatar Dec 21 '16 06:12 abhinaypandey

You're using "[email protected]" which won't work with angular 2.3.x

scttcper avatar Dec 21 '16 06:12 scttcper

thanks @scttcper . That worked like charm.

abhinaypandey avatar Dec 21 '16 07:12 abhinaypandey

Hey guys I'm facing same issue with Angular 2.4.9.. any ideas?

Current behavior /modules/@angular/compiler-cli/src/version.ts:19 export const VERSION = new Version('2.4.9'); ^ TypeError: core_1.Version is not a constructor at Object. (/modules/@angular/compiler-cli/src/version.ts:19:24) at Module._compile (module.js:571:32) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3) at Module.require (module.js:498:17) at require (internal/module.js:20:19) at Object. (/modules/@angular/compiler-cli/index.ts:13:1) at Module._compile (module.js:571:32) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3) at Module.require (module.js:498:17) at require (internal/module.js:20:19) at Object. (/node_modules/src/main.ts:7:1) at Module._compile (module.js:571:32) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3)

npm ERR! Linux 3.13.0-68-generic npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "server:dev" npm ERR! node v7.6.0 npm ERR! npm v3.10.8 npm ERR! code ELIFECYCLE npm ERR! [email protected] server:dev: webpack-dev-server --config config/webpack.dev.js --open --progress --profile --watch --content-base src/ npm ERR! Exit status 1

Expected behavior normal "npm install" process

Minimal reproduction of the problem with instructions When I'm adding "@angular/compiler-cli": "2.4.9", to the package.json and executing "npm install" the above error arise.

What is the motivation / use case for changing the behavior?

Please tell us about your environment: node v7.6.10 npm v3.10.8

  • Angular version: 2.4.9

ghost avatar Mar 06 '17 17:03 ghost

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.