I dont know whats going on. Cant find the solution through a google search. Any ideas here? I just want to be able to console.log the tools.fetch so I can see data in dev tools.
This is what I am trying to fetch ( https://www.npmjs.com/package/otter-api )
1.) JS
tools = require('otter-api');
tools.fetch().then(l => console.log(l))
2.) HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script src="script.js"></script>
</body>
</html>
3.) In terminal: (this will create packagejson, node_module folders) npm i
and then...
npm install otter-api
4.) ENDING COMMENT I tried chnaging variable names, added const fs = require('fs') thinking that would initiate something.
important question, just how there is an npx react install to set up the entire foundation for a react file, if there also one for when working with a node project to avoid stuff like this?