My current versions of node
and npm
are:
node --version
v10.15.3
npm --version
6.9.0
An error message I encountered is as follows:
ERROR in src/app/model/testing/index.ts(1,15): error TS2307: Cannot find module './fake-hero.service'.
src/testing/jasmine-matchers.d.ts(3,67): error TS2694: Namespace 'jasmine' has no exported member 'CustomMatcher'.
src/testing/jasmine-matchers.ts(7,3): error TS2708: Cannot use namespace 'jasmine' as a value.
src/testing/jasmine-matchers.ts(12,32): error TS2694: Namespace 'jasmine' has no exported member 'CustomMatcher'.
src/testing/jasmine-matchers.ts(14,97): error TS2694: Namespace 'jasmine' has no exported member 'CustomMatcherResult'.
The issue was resolved by commenting out the following line in the file src/app/model/testing/index.ts
:
//export * from './fake-hero.service';
Although it initially appeared to be related to jasmine
and CustomMatcher
, further investigation revealed that wasn't the case.
Interestingly, stopping the server and running ng serve
resulted in another jasmin
related error. However, simply adding a space in the commented line within the file (index.ts) allowed successful compilation!
Below are my devDependencies:
"devDependencies": {
"@angular-devkit/build-angular": "^0.11.0",
"@angular/cli": "^7.1.0",
"@angular/compiler-cli": "^7.1.0",
"@angular/platform-server": "^7.1.0",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "^2.0.4",
"@types/node": "~8.9.4",
"jasmine-core": "~2.99.1",
"jasmine-marbles": "^0.4.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~3.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"lodash": "^4.16.2",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "~3.1.1"
}