The answer for tfjs-npy-node is to install a different library @tensorflow/tfjs-backend-cpu and import import "@tensorflow/tfjs-backend-cpu" into the project. Idk if there is a fix for npyjs yet.
tfjs-npy-node
@tensorflow/tfjs-backend-cpu
import "@tensorflow/tfjs-backend-cpu"