On a smooth algebraic variety X, every coherent sheaf F has a finite resolution by locally free sheaves. Using such resolution, we can define the determinant of F, det F, which is a line bundle on X.

My question is :

why if the support of F is of codimension greater or equal to 2 is the determinant of F trivial ?

It is mentionned without proof on the book "The geometry of moduli spaces of sheaves", D. Huybrechts, M. Lehn. I have verified this result on some explicit examples for which I know some explicit locally free resolutions but I don't see how to do the general case.