For this kind of task using ECMWF data it is usually better to install eccodes.
For example on a mac you can do
brew install eccodes
This will give you a lot of useful command line tools and, as long as the input file is on a regular lat/lon grid or a regular Gaussian grid (the key "typeOfGrid" should be "regular_ll" or "regular_gg") you can convert to netcdf
grib_to_netcdf -o output.nc input.grb
This tool is more powerful than CDO in that it can handle multiple time axes (e.g. seasonal forecasts with multiple start dates) and also extra dimensions such as ensemble member number, which can trip CDO up.
NOTE: The title to the question states netcdf4 is required but you used the -f nc option for cdo. Note that to specify netcdf4 with cdo you should use
cdo -f nc4