Spark Dev: Cannot find module 'getmac'

Heya guys, I’m having issues flashing a program with Spark Dev (OS X 10.10.3). When I attempt to Verify or Flash any code I get the follow error in the console:

Failed to activate package named 'metrics' Error: Cannot find module 'getmac'
  at Module._resolveFilename (module.js:344:15)
  at Function.Module._resolveFilename (/Applications/Spark
  at Function.Module._load (module.js:286:25)
  at Module.require (module.js:373:17)
  at require (module.js:392:17)
  at Object.module.exports.getUserId (/Applications/Spark
  at Object.module.exports.activate (/Applications/Spark
  at Package.module.exports.Package.activateNow (/Applications/Spark
  at /Applications/Spark
  at Package.module.exports.Package.measure (/Applications/Spark
  at Package.module.exports.Package.activate (/Applications/Spark
  at PackageManager.module.exports.PackageManager.activatePackage (/Applications/Spark
  at PackageManager.module.exports.PackageManager.activatePackages (/Applications/Spark
  at PackageManager.module.exports.PackageManager.activate (/Applications/Spark
  at Atom.module.exports.Atom.startEditorWindow (/Applications/Spark
  at Object.<anonymous> (/Applications/Spark
  at Object.<anonymous> (/Applications/Spark
  at Module._compile (module.js:468:26)
  at Object.Module._extensions..js (module.js:486:10)
  at Module.load (/Applications/Spark
  at Function.Module._load (module.js:318:12)
  at Module.require (module.js:373:17)
  at require (module.js:392:17)
  at window.onload (file:///Applications/
Window load time: 821ms index.js:39
Uncaught TypeError: Cannot read property '0' of undefined /Applications/Spark
Uncaught Error: Cannot find module 'request' module.js:346

Google didn’t turn up much. I verified I have getmac installed on my machine. Also I noticed getmac is not in Spark
Anyone of some tips on how to get passed this issue?

@suda might need your help here.

It looks like the metrics package is acting up. Could you try going to Settings, disable it and try again?

Thanks for the suggestion! I ended up copying getmac and request to node_modules in the app bundle. I still can’t get passed this error:

Uncaught TypeError: Cannot read property '0' of undefined /Applications/Spark

Any suggestions are greatly appreciated :smile:

Found this issue which describes this problem. Moving file to its own dir solved it.

1 Like

How does one go into settings?

Where did you copy the ‘getmac’ program from?

Have you tried installing the latest version of Spark Dev?

I installed the atom 0.196.0 which is apparently the latest version of spark dev, the ide didn’t even have a run button so I went back to the old version

The separate package for Atom hasn’t been updated yet. Could you try installing Spark Dev bundle from ?

I’ll try to reinstall it, and does it matter where I store the setup for the software?

So I installed it and now it’s saying “Uncaught error: Invalid port specified: undefined”

Does it say that right after launching or after you open Serial Monitor?

After I open the serial monitor

Could you try removing contents of %HOME%\.spark directory?

what’s the full adress of that directory?

Hi @thespark

The %HOME% is an environment variable that points to your home directory. You can try

echo %HOME%

to see where that is.

Do I put that on some command prompt or something?

Hi @thespark

If you are using Windows, open up a cmd shell also called Command Prompt and type echo %HOME% and hit return to see where that directory is.

It’s not returning anything