{"action":"opened","issue":{"url":"https://api.github.com/repos/electron/electron/issues/5520","repository_url":"https://api.github.com/repos/electron/electron","labels_url":"https://api.github.com/repos/electron/electron/issues/5520/labels{/name}","comments_url":"https://api.github.com/repos/electron/electron/issues/5520/comments","events_url":"https://api.github.com/repos/electron/electron/issues/5520/events","html_url":"https://github.com/electron/electron/issues/5520","id":154736037,"number":5520,"title":"Module loading broken in e2e tests with protractor / angular","user":{"login":"kieronbrowne","id":1749454,"avatar_url":"https://avatars.githubusercontent.com/u/1749454?v=3","gravatar_id":"","url":"https://api.github.com/users/kieronbrowne","html_url":"https://github.com/kieronbrowne","followers_url":"https://api.github.com/users/kieronbrowne/followers","following_url":"https://api.github.com/users/kieronbrowne/following{/other_user}","gists_url":"https://api.github.com/users/kieronbrowne/gists{/gist_id}","starred_url":"https://api.github.com/users/kieronbrowne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kieronbrowne/subscriptions","organizations_url":"https://api.github.com/users/kieronbrowne/orgs","repos_url":"https://api.github.com/users/kieronbrowne/repos","events_url":"https://api.github.com/users/kieronbrowne/events{/privacy}","received_events_url":"https://api.github.com/users/kieronbrowne/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-13T15:16:43Z","updated_at":"2016-05-13T15:16:43Z","closed_at":null,"body":"* Electron version: >=0.37 (inc. 1.0.2)\r\n* Operating system: Ubuntu and Windows\r\n\r\nI have managed to configure the Angular end-to-end testing tool Protractor to work with an Angular app running in Electron. A skeleton project can be seen here: https://github.com/kieronbrowne/electron-angular-protractor.git. This has been working fine up to version 0.36 of Electron.\r\n\r\nSince Electron v0.37.x and including 1.0.x, 'require' (or nodeRequire - as I have followed the advice in the Electron FAQ about conflicts with Angular's require) has stopped finding the node modules during protractor tests.\r\n\r\nIf I output `__dirname` from the browser, I get `<appDir>/node_modules/electron-prebuilt/dist/resources/electron.asar/renderer`, when I expected to get my application directory, which is what I get when the application is run directly in Electron.\r\n\r\nTo reproduce:\r\n1. Clone the git repository above\r\n2. `npm install`\r\n3. `./node_modules/electron_prebuilt/dist/electron .` to see standard behaviour (hello world displayed)\r\n4. `npm run protractor` to see protractor working normally (this is Electron-v0.36.12). Note the __dirname output is the app directory.\r\n5. Switch to the 'dirname-bug' branch (which just has electron-prebuilt bumped to v1.0 in package.json)\r\n6. `npm install` to take the newer Electron\r\n7. Repeat step 3 (which works ok), and step 4 (which will fail - unable to load 'lodash').\r\n"}}