The requirejs website does give the first example ...
# suitescript
n
The requirejs website does give the first example you gave, and installing
npm install -D amdefine
is working for both
npm test
and running in Netsuite. Thanks so much @michoel