diff --git a/lib/preferences.js b/lib/preferences.js
index <HASH>..<HASH> 100644
--- a/lib/preferences.js
+++ b/lib/preferences.js
@@ -31,14 +31,21 @@ Preferences.write = function(key, value) {
       .then(contents => {
         contents = contents || {};
         contents[key] = value;
-        fs.writeFile(preferencesJson, JSON.stringify(contents), function(error) {
+        fs.ensureFile(preferencesJson, function(err){
           if (error) {
             log.error('Error writing preference', key, value);
             reject(error);
           } else {
-            resolve();
+            fs.writeFile(preferencesJson, JSON.stringify(contents), function(error) {
+              if (error) {
+                log.error('Error writing preference', key, value);
+                reject(error);
+              } else {
+                resolve();
+              }
+            });
           }
-        });
+        })
       })
       .catch(error => {
         reject(error);
fs.ensureFile to fix missing .tessel dir in Preferences.write

Fix for issue #<I>