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 Dev.app/Contents/Resources/app/src/module-cache.js:380:52)
  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 Dev.app/Contents/Resources/app/node_modules/metrics/lib/metrics.js:49:14)
  at Object.module.exports.activate (/Applications/Spark Dev.app/Contents/Resources/app/node_modules/metrics/lib/metrics.js:15:14)
  at Package.module.exports.Package.activateNow (/Applications/Spark Dev.app/Contents/Resources/app/src/package.js:225:27)
  at /Applications/Spark Dev.app/Contents/Resources/app/src/package.js:211:28
  at Package.module.exports.Package.measure (/Applications/Spark Dev.app/Contents/Resources/app/src/package.js:157:15)
  at Package.module.exports.Package.activate (/Applications/Spark Dev.app/Contents/Resources/app/src/package.js:205:14)
  at PackageManager.module.exports.PackageManager.activatePackage (/Applications/Spark Dev.app/Contents/Resources/app/src/package-manager.js:404:21)
  at PackageManager.module.exports.PackageManager.activatePackages (/Applications/Spark Dev.app/Contents/Resources/app/src/package-manager.js:393:14)
  at PackageManager.module.exports.PackageManager.activate (/Applications/Spark Dev.app/Contents/Resources/app/src/package-manager.js:379:19)
  at Atom.module.exports.Atom.startEditorWindow (/Applications/Spark Dev.app/Contents/Resources/app/src/atom.js:516:21)
  at Object.<anonymous> (/Applications/Spark Dev.app/Contents/Resources/app/src/window-bootstrap.js:12:8)
  at Object.<anonymous> (/Applications/Spark Dev.app/Contents/Resources/app/src/window-bootstrap.js:23:4)
  at Module._compile (module.js:468:26)
  at Object.Module._extensions..js (module.js:486:10)
  at Module.load (/Applications/Spark Dev.app/Contents/Resources/app/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
  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/Spark%20Dev.app/Contents/Resources/app/static/index.js:34:25)
 /Applications/Spark Dev.app/Contents/Resources/app/src/package.js:230
Window load time: 821ms index.js:39
Uncaught TypeError: Cannot read property '0' of undefined /Applications/Spark Dev.app/Contents/Resources/app/node_modules/spark-dev/node_modules/when/lib/decorators/unhandledRejection.js:79
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 Dev.app/Contents/Resources/app/node_modules/
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 Dev.app/Contents/Resources/app/node_modules/spark-dev/node_modules/when/lib/decorators/unhandledRejection.js:79

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 https://www.spark.io/dev ?

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