How do you resolve modules to use the smartsheet npm package on nodejs?
I am trying to use the Smartsheet API on nodejs (v8) on windows. When I add the smartsheet npm package, my solution no longer compiles. Easiest way to reproduce (though it reproduces without using create-react-app):
> npx create-react-app solutionname
> cd solutionname
> npm start
It works - your browser comes up with the default page showing.
> npm install --save smartsheet
You now need to reference smartsheet in the project. Open solutionname/src/App.js in your favorite text editor and at the top of the file, under the line that says import './App.css' add a new line, per the API docs:
var client = require('smartsheet');
Save and close the file.
> npm start
The solution no longer compiles. In the browser, you see the following error:
Failed to compile
Module not found: Can't resolve 'request' in 'solutionname\node_modules\smartsheet\lib\utils'
You see the same 'Module not found' error in your console window.
I call it out on windows because when you install the smartsheet npm package, you get a missing optional dependency for fsevents that is skipped because the platform is not OSX. FWIW I get this same exact error on Linux Mint.
Any idea of how this can be resolved to work?