angular / components

Component infrastructure and Material Design components for Angular
https://material.angular.io
MIT License
24.23k stars 6.7k forks source link

[CDK] Can't run unit test #10648

Closed Tomek6789 closed 6 years ago

Tomek6789 commented 6 years ago

Bug, feature request, or proposal:

Bug

What is the expected behavior?

gulp test should run unit test.

What is the current behavior?

Error: The Angular Compiler requires TypeScript >=2.7.2 and <2.8.0 but 2.8.1 was found instead.
    at new AngularCompilerProgram (material2/node_modules/@angular/compiler-cli/src/transformers/program.js:84:19)
    at Object.createProgram (material2/node_modules/@angular/compiler-cli/src/transformers/program.js:687:12)
    at Object.performCompilation (material2/node_modules/@angular/compiler-cli/src/perform_compile.js:170:22)
    at main (material2/node_modules/@angular/compiler-cli/src/main.js:20:61)
    at Object.<anonymous> (material2/node_modules/@angular/compiler-cli/src/main.js:122:24)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

Failed to compile  using /home/tomek/Javascript/Testy/angularMaterial2/material2/src/cdk/tsconfig-tests.json
[22:05:11] 'cdk:build:esm:tests' errored after 549 ms
[22:05:11] Error: Failed to compile  using /home/tomek/Javascript/Testy/angularMaterial2/material2/src/cdk/tsconfig-tests.json

What are the steps to reproduce?

  1. npm install will update typescript to 2.8.1
  2. gulp test

What is the use-case or motivation for changing an existing behavior?

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Is there anything else we should know?

CaerusKaru commented 6 years ago

This is because the current package.json includes a version of TypeScript that is not locked down to v2.7 (the only version supported by Angular at the moment). If you manually install TypeScript v2.7 using npm install typescript@2.7 -D, it should fix this issue.

angular-automatic-lock-bot[bot] commented 4 years ago

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.