When there was a syntax error in package.json, the failure could be cryptic because there was no context suggesting that npm or yarn had been invoked. That happened because the deployer attempted to parse package.json itself to determine whether there is a build script in it and that parse attempt was not guarded by try/catch. This change simply adds the guard to prevent the parse exception from propagating. There is no special handling for the failure (other than ignoring it) because the next step will be to invoke npm or yarn, which will fail much more informatively.
When there was a syntax error in
package.json
, the failure could be cryptic because there was no context suggesting thatnpm
oryarn
had been invoked. That happened because the deployer attempted to parsepackage.json
itself to determine whether there is a build script in it and that parse attempt was not guarded by try/catch. This change simply adds the guard to prevent the parse exception from propagating. There is no special handling for the failure (other than ignoring it) because the next step will be to invokenpm
oryarn
, which will fail much more informatively.