'Getting type error when trying to instantiate a sinon anonymous stub

I am using Node.JS v17.4.0 with "sinon": "^13.0.1",. A simple code snippet like the following:

import sinon from 'sinon';
const stub = sinon.stub();

throws TypeError: Cannot read properties of undefined (reading 'stub'). What do I miss?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source