Experience-Monks / devtool

[OBSOLETE] runs Node.js programs through Chromium DevTools
MIT License
3.77k stars 150 forks source link

Cannot read property 'commandLine' of undefined #64

Closed zeke closed 8 years ago

zeke commented 8 years ago

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)
mattdesl commented 8 years ago

Hmm probably Electron APIs have changed. The package json here should maybe just lock to a specific version of electron.

mattdesl commented 8 years ago

I just used nvm install 6.2 with npm@3.8.9 and npm install devtool -g, can't seem to reproduce this. What OS?

PaulBGD commented 8 years ago

Running on mac with node v6.2 and npm v3.8.9 and I get the same error.

App threw an error when running 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:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at loadApplicationPackage (/usr/local/lib/node_modules/devtool/node_modules/electron-prebuilt/dist/Electron.app/Contents/Resources/default_app.asar/main.js:252:23)
    at Object.<anonymous> (/usr/local/lib/node_modules/devtool/node_modules/electron-prebuilt/dist/Electron.app/Contents/Resources/default_app.asar/main.js:292:5)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
/usr/local/lib/node_modules/devtool/node_modules/electron-prebuilt/dist/Electron.app/Contents/Resources/default_app.asar/main.js:266
      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:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at loadApplicationPackage (/usr/local/lib/node_modules/devtool/node_modules/electron-prebuilt/dist/Electron.app/Contents/Resources/default_app.asar/main.js:252:23)
    at Object.<anonymous> (/usr/local/lib/node_modules/devtool/node_modules/electron-prebuilt/dist/Electron.app/Contents/Resources/default_app.asar/main.js:292:5)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
zeke commented 8 years ago

OS X 10.11.4 El Capitan

mattdesl commented 8 years ago

Hmm, have you guys tried devtool@2.0.1? I am on the same setup as you but I can't reproduce with npm i devtool -g.

Synvox commented 8 years ago

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
mattdesl commented 8 years ago

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.

zeke commented 8 years ago

That was it! Cheers.