question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot read property 'commandLine' of undefined

See original GitHub issue

https://github.com/Jam3/devtool/blob/dab319eef616f995d3c6d497c4afee2ae891cf54/server.js#L20

❯ node -v 
v6.2.0

❯ npm i -g devtool
/usr/local/bin/devtool -> /usr/local/lib/node_modules/devtool/bin/index.js
/usr/local/lib
└── devtool@1.11.2 

❯ devtool
App threw an error when running [TypeError: Cannot read property 'commandLine' of undefined]
/usr/local/lib/node_modules/devtool/node_modules/electron-prebuilt/dist/Electron.app/Contents/Resources/default_app.asar/main.js:267
      throw e
      ^

TypeError: Cannot read property 'commandLine' of undefined
    at Object.<anonymous> (/usr/local/lib/node_modules/devtool/server.js:20:4)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at loadApplicationPackage (/usr/local/lib/node_modules/devtool/node_modules/electron-prebuilt/dist/Electron.app/Contents/Resources/default_app.asar/main.js:253:23)
    at Object.<anonymous> (/usr/local/lib/node_modules/devtool/node_modules/electron-prebuilt/dist/Electron.app/Contents/Resources/default_app.asar/main.js:293:5)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mattdeslcommented, May 31, 2016

I think it’s because of the electron module which some devs have accidentally installed globally (thinking it is related to Atom’s Electron). It seems like Electron should guard against this somehow.

1reaction
Synvoxcommented, May 31, 2016

I was getting the same error this morning. I think I’ve pinned down the problem, and it isn’t a problem with devtool or electron. It happens when electron is installed globally, so remove it and install devtool again.

Here’s what I did and it’s up and running.

npm remove electron -g
npm remove devtool -g
npm install devtool -g
Read more comments on GitHub >

github_iconTop Results From Across the Web

npm err! cannot read properties of undefined (reading 'name')
Solution 1: Clear Cache. First you need to clear your cache by this command: npm cache clear --force. Now, run npm install command....
Read more >
Electron - "Cannot read property 'on' of undefined"; tried ...
Using the command line to troubleshoot, I'm seeing that app and ipc variables are undefined but the other required variables (like os, fs,...
Read more >
Cannot read property 'length' of undefined on forge/cli v1.3.4
After downloading a working codebase I started seeing the following error: Error: Cannot read property 'length' of undefined TypeError: ...
Read more >
[Electron Quick Start Issue] TypeError: Cannot read property ...
... [Electron Quick Start Issue] TypeError: Cannot read property 'on' of undefined ... Try to run npm install --save-dev electron again Make sure...
Read more >
How To Fix TypeError: Cannot Read Property - Tom McFarlin
The best solution I've found to the problem is to remove webpack and the webpack-cli and reinstall it using the --save-dev directive.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found