Install tensorflow with node.js can not use

Hello i’m a newbie for tensorflow, Now i use Node.js is core language and already install tensorflow by npm

  • @tensorflow/tfjs
  • @tensorflow/tfjs-node
  • @tensorflow/tfjs-node-gpu

and require like this

  • const tf = require(’@tensorflow/tfjs’)
  • require(’@tensorflow/tfjs-node’)
  • require(’@tensorflow/tfjs-node-gpu’)

But when I try to use it occur error
const tf = require(’@tensorflow/tfjs’)
TypeError: require is not a function

How to solve it

Thank you

TensorFlow.js is a library for machine learning in JavaScript. Develop ML models in JavaScript, and use ML directly in the browser or in Node.js.