Hi! So I want to use Node.js, but I wanted to know if I can turn a normal script.js file into a node.js file. For example, can I just run this to add node.js onto my HTML website:
<script src="script.js"></script>
and have it normally act as a JS file?
Thanks!
Top comments (2)
No
No, that would be a client-side script. You need to switch to using a server instead of a static website and install Node.js on that server. It comes pre-installed on glitch, but you need to add a package.json file.