According to [these lines](https://github.com/cisco/node-jose/blob/003ef1c1488c5006976e4ead72bf40f63c4b098d/lib/jws/sign.js#L302-L309), the `alg` should be set inside `fields` object as it's a header.