Closed zeke closed 8 years ago
Hmm probably Electron APIs have changed. The package json here should maybe just lock to a specific version of electron.
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?
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)
OS X 10.11.4 El Capitan
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
.
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
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.
That was it! Cheers.
https://github.com/Jam3/devtool/blob/dab319eef616f995d3c6d497c4afee2ae891cf54/server.js#L20