You’re missing the MatchSignal function in the hooks, it was introduced in Nakama v3.8.0, the body of the function can just return the state, see an example here.
If you’re looking to install the TypeScript definitions you should use npm i 'https://github.com/heroiclabs/nakama-common#master'. If you want to update them npm update nakama-runtime should work.
Try deleting the node-modules folder, as well as the package.json and package-lock.json files and try npm i 'https://github.com/heroiclabs/nakama-common#master again, then retry to recompile please and let me know if that worked.