1
votes

I'm trying to get tensorflow.js working within my existing angular project. Once I start compiling my project with ng serve I get the following error:

ERROR in node_modules/@tensorflow/tfjs-layers/dist/engine/training_utils.d.ts(71,92): error TS1005: '>' expected. node_modules/@tensorflow/tfjs-layers/dist/engine/training_utils.d.ts(71,129): error TS1109: Expression expected.

I have the following local versions in my project:

  • "@tensorflow/tfjs": "^1.2.8"
  • local Angular CLI version 1.7.4
  • "typescript": "^2.6.2"
1
How did you install tensorflow/tfjs, I mean which command line did you use for npm install ?edkeveked
Yes, used npm install. But I just fixed the error myself by simply updating my typescript version to 3.3.3333DarkIudeX

1 Answers

0
votes

By checking the documentation here, you can find the following statement:

When using TypeScript you may need to set skipLibCheck: true in your tsconfig.json file if your project makes use of strict null checking or you will run into errors during compilation.

So, you should set the following setting on the tsconfig.json:

"skipLibCheck": true

If the error persists, try to update your typescript version to 3+;