bbc / speculate

Automatically generates an RPM Spec file for your Node.js project
Other
66 stars 28 forks source link

Set NODE_ENV=production when running npm prune #95

Closed awalsh closed 2 years ago

awalsh commented 2 years ago

We've seen issues whereby npm prune --production on NPM 8 running inside mock (with no internet access) fails because its trying to resolve dev dependencies. The fix for this would be to change to npm prune --omit=dev which would stop trying to resolve dev dependencies. However some users of speculate use NPM 6, which does not support --omit=dev.

According to https://docs.npmjs.com/cli/v8/commands/npm-prune and https://docs.npmjs.com/cli/v6/commands/npm-prune, setting NODE_ENV=production will have the same effect as --omit=dev on NPM 8 and --production on NPM 6 respectively.