Microsoft introduced a great feature in SQL Server 2016 that support JSON data. However, you can get the error
Invalid object name OPENJSON
when you work on databases that their compatibility level are lower than 130.
To fix this error, you need to update your database compatibility to 130
ALTER DATABASE <Database Name> SET COMPATIBILITY_LEVEL = 130