Files app showing the import error while importing npm modules in js folder

In the files app trying to import the node modules in the file ā€œfile-upload.jsā€. which gives the error ā€œCannot use import statement outside a moduleā€ā€¦although node_modules folder and package.json folder are inside the files app.i have also tried adding type=ā€œmoduleā€ā€¦it did not solve the issue.
version:
nc18
PHP 7.2.24-0
ubuntu0.18.04.4

Have you find a solution ?