Error: Cannot find module 'typescript'

I am facing same error in my Azure Devops build .
I tried the commands:

setx NODE_PATH “$(Build.SourcesDirectory)\node_modules” /M

cd $(Build.SourcesDirectory)

npm install -D typescript

But the error continues.

Any thoughts?