diff --git a/lib/version.js b/lib/version.js
index 25effa9edf56e45d9fb2e22e51f05d32ad0ea781..f46ae9fab7475522656ec1d81b58bd9825b0f33b 100644
--- a/lib/version.js
+++ b/lib/version.js
@@ -12,23 +12,26 @@ fs = require('fs'),
 path = require('path'),
 logger = require('./logging.js').logger,
 spawn = require('child_process').spawn,
-secrets = require('./secrets.js');
+secrets = require('./secrets.js'),
+config = require('./configuration');
 
 var sha;
 
 // first try ver.txt which by convention is placed in repo root at
 // deployment time
-try {
-  var contents = fs.readFileSync(path.join(__dirname, '..', 'resources', 'static', 'ver.txt'));
-  sha = contents.toString().split(' ')[0];
-  if (sha.length != 7) throw "bad sha in ver.txt";
-} catch(e) {
-  sha = undefined;
-  logger.debug('cannot read code version from ver.txt: ' + e);
+if (config.get('env') === 'production') {
+  try {
+    var contents = fs.readFileSync(path.join(__dirname, '..', 'resources', 'static', 'ver.txt'));
+    sha = contents.toString().split(' ')[0];
+    if (sha.length != 7) throw "bad sha in ver.txt";
+  } catch(e) {
+    sha = undefined;
+    logger.debug('cannot read code version from ver.txt: ' + e);
+  }
 }
 
 // now set the SHA to either the read SHA or a random string
-module.exports = function() { return sha; }
+module.exports = function() { return sha; };
 
 // if ver.txt discovery failed, try using git to get the sha.
 if (!sha) {