'Unable to execute java script program from docker container using

I am trying to run a javascript program from docker container and getting the following error:
   node:internal/modules/cjs/loader:936
      throw err;
      ^
    Error: Cannot find module '/testapp/hello.js'
        at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
        at Function.Module._load (node:internal/modules/cjs/loader:778:27)
        at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
        at node:internal/main/run_main_module:17:47 {
      code: 'MODULE_NOT_FOUND',
      requireStack: []
    }
    Node.js v17.7.1

Error and the command executed can be viewed in the image attached Also have ensured that file hello.js exist locally in the directory mentioned in the command. Image used is of node with the tag:latest



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source