When I tried to import an valid node_module it throws an error?
<script >
var Twit = require('twit');
</script>
Error:
Uncaught ReferenceError: require is not defined
My doubt is the require() function is running fine on js file but not in HTML file.
It also not working when I import the js file in the script tag.
<script src="s.js"></script>
NOTE My nodejs version is v14.15.4
I am new to nodejs and I am sorry if my approach is wrong