Problem building node red locally

I am trying to build node-red locally, I followed the instructions at Running Node-RED from source : Node-RED.

When I ran grunt build I got

$ grunt build
(node:29679) [DEP0187] DeprecationWarning: Passing invalid argument types to fs.existsSync is deprecated
(Use `node --trace-deprecation ...` to show where the warning was created)
grunt-cli: The grunt command line interface (v1.5.0)

Fatal error: Unable to find local grunt.

If you're seeing this message, grunt hasn't been installed locally to
your project. For more information about installing and configuring grunt,
please see the Getting Started guide:

https://gruntjs.com/getting-started

I then tried installing grunt locally npm install grunt and then got

$ grunt build
(node:31610) [DEP0187] DeprecationWarning: Passing invalid argument types to fs.existsSync is deprecated
(Use `node --trace-deprecation ...` to show where the warning was created)
A valid Gruntfile could not be found. Please see the getting started guide for
more information on how to configure grunt: http://gruntjs.com/getting-started
Fatal error: Unable to find Gruntfile.

What am I doing wrong?

This documentation is outdated:

Try npm run dev or npm run build instead.

There are a number of scripts prepared for various dev related actions.

OK, thanks.

Oh yes, those docs need updating. Apologies for missing that.

On the whole, use npm run <task> in place of grunt <task>

All working now, thanks.