I wanted to use this npm package https://github.com/nefe/number-precision, follow the steps but not working.
npm install number-precision --save--dep
import NP from 'number-precision'orrequire()on my JS file first-line , the error message will like this : Cannot define require && export or Cannot use import statement outside a module.<script src="node_modules/number-precision/build/index.iife.js">import NP from 'number-precision </script>It won't show any error message but in my js file, NP method still doesn't work.
<script src="/workout.js"></script>and put on my js file first-lineimport NP from 'number- precision'I got this:
refused to execute script from 'http://0.0.0.0:2000/node_modules/number- precision/' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
How do I correctly execute this npm package in my js file?