VSCode to Github on Windows 11 using Github Desktop - github

Hello: I'm on Windows 11 trying to check-in from VSCode to Github (I have Github desktop installed) - I am receiving the error below - What am I missing ?
[2022-03-16T21:53:28.727Z] > git config --get commit.template [56ms]
[2022-03-16T21:53:28.727Z] node:internal/modules/cjs/loader:943
throw err; ^
Error: Cannot find module
'C:\Users[user]\AppData\Local\GitHubDesktop\app-2.9.11\config'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:940:15)
at Module._load (node:internal/modules/cjs/loader:785:27)
at Function.c._load (node:electron/js2c/asar_bundle:5:13331)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47 { code: 'MODULE_NOT_FOUND', requireStack: [] }
[2022-03-16T21:54:24.486Z] > git symbolic-ref --short HEAD [59ms]
[2022-03-16T21:54:24.486Z] node:internal/modules/cjs/loader:943
throw err;
^Error: Cannot find module
'C:\Users[user]\AppData\Local\GitHubDesktop\app-2.9.11\symbolic-ref'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:940:15)
at Module._load (node:internal/modules/cjs/loader:785:27)
at Function.c._load (node:electron/js2c/asar_bundle:5:13331)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47 { code: 'MODULE_NOT_FOUND', requireStack: [] }
[2022-03-16T21:54:24.545Z] > git rev-parse HEAD [56ms]
[2022-03-16T21:54:24.545Z] node:internal/modules/cjs/loader:943
throw err; ^
Error: Cannot find module
'C:\Users[user]\AppData\Local\GitHubDesktop\app-2.9.11\rev-parse'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:940:15)
at Module._load (node:internal/modules/cjs/loader:785:27)
at Function.c._load (node:electron/js2c/asar_bundle:5:13331)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47 { code: 'MODULE_NOT_FOUND', requireStack: [] }

Related

Failed to open terminal on code-server on alpine linux

The terminal process failed to launch: A native exception occurred during launch (Error relocating /usr/lib/node_modules/code-server/lib/vscode/node_modules/node-pty/build/Release/pty.node: _ZN2v816FunctionTemplate3NewEPNS_7IsolateEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEENS_5LocalIS4_EENSA_INS_9SignatureEEEiNS_19ConstructorBehaviorENS_14SideEffectTypeEPKNS_9CFunctionE: symbol not found).
My user settings value:
{
"go.useLanguageServer": true
}
My terminal logs showed these errors:
[2021-01-14T08:11:39.587Z] info code-server 3.8.0 c4610f7829701aadb045d450013b84491c30580d
[2021-01-14T08:11:39.590Z] info Using user-data-dir ~/.local/share/code-server
[2021-01-14T08:11:39.695Z] info Using config file ~/.config/code-server/config.yaml
[2021-01-14T08:11:39.695Z] info HTTP server listening on http://127.0.0.1:8080
[2021-01-14T08:11:39.696Z] info - Authentication is enabled
[2021-01-14T08:11:39.696Z] info - Using password from ~/.config/code-server/config.yaml
[2021-01-14T08:11:39.696Z] info - Not serving HTTPS
Error: Error relocating /usr/lib/node_modules/code-server/lib/vscode/node_modules/spdlog/build/Release/spdlog.node: _ZN2v816FunctionTemplate3NewEPNS_7IsolateEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEENS_5LocalIS4_EENSA_INS_9SignatureEEEiNS_19ConstructorBehaviorENS_14SideEffectTypeEPKNS_9CFunctionE: symbol not found
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1057:18)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at Module.patchedRequire [as require] (/usr/lib/node_modules/code-server/lib/vscode/node_modules/diagnostic-channel/dist/src/patchRequire.js:14:46)
at require (internal/modules/cjs/helpers.js:74:18)
at bindings (/usr/lib/node_modules/code-server/lib/vscode/node_modules/bindings/bindings.js:112:48)
at Object.<anonymous> (/usr/lib/node_modules/code-server/lib/vscode/node_modules/spdlog/index.js:3:35)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at Module.patchedRequire [as require] (/usr/lib/node_modules/code-server/lib/vscode/node_modules/diagnostic-channel/dist/src/patchRequire.js:14:46)
at require (internal/modules/cjs/helpers.js:74:18)
at t.load (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:17:960)
at e.load (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:13:941)
at o (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:31:189)
at Object.errorback (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:31:313)
at e.triggerErrorback (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:14:306)
at /usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:14:10
at ReadFileContext.callback (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:18:342)
at FSReqCallback.readFileAfterOpen [as oncomplete] (fs.js:261:13) {
phase: 'loading',
moduleId: 'spdlog',
neededBy: [ '===anonymous3===' ]
}
Error: Error relocating /usr/lib/node_modules/code-server/lib/vscode/node_modules/spdlog/build/Release/spdlog.node: _ZN2v816FunctionTemplate3NewEPNS_7IsolateEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEENS_5LocalIS4_EENSA_INS_9SignatureEEEiNS_19ConstructorBehaviorENS_14SideEffectTypeEPKNS_9CFunctionE: symbol not found
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1057:18)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at Module.patchedRequire [as require] (/usr/lib/node_modules/code-server/lib/vscode/node_modules/diagnostic-channel/dist/src/patchRequire.js:14:46)
at require (internal/modules/cjs/helpers.js:74:18)
at bindings (/usr/lib/node_modules/code-server/lib/vscode/node_modules/bindings/bindings.js:112:48)
at Object.<anonymous> (/usr/lib/node_modules/code-server/lib/vscode/node_modules/spdlog/index.js:3:35)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at Module.patchedRequire [as require] (/usr/lib/node_modules/code-server/lib/vscode/node_modules/diagnostic-channel/dist/src/patchRequire.js:14:46)
at require (internal/modules/cjs/helpers.js:74:18)
at t.load (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:17:960)
at e.load (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:13:941)
at o (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:31:189)
at Object.errorback (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:31:313)
at e.triggerErrorback (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:14:306)
at /usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:14:10
at ReadFileContext.callback (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:18:342)
at FSReqCallback.readFileAfterOpen [as oncomplete] (fs.js:261:13) {
phase: 'loading',
moduleId: 'spdlog',
neededBy: [ '===anonymous3===' ]
}
[2021-01-14T08:11:52.407Z] error exthost console {"arguments":"[\"Error: Error relocating /usr/lib/node_modules/code-server/lib/vscode/node_modules/spdlog/build/Release/spdlog.node: _ZN2v816FunctionTemplate3NewEPNS_7IsolateEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEENS_5LocalIS4_EENSA_INS_9SignatureEEEiNS_19ConstructorBehaviorENS_14SideEffectTypeEPKNS_9CFunctionE: symbol not found\\n at Object.Module._extensions..node (internal/modules/cjs/loader.js:1057:18)\\n at Module.load (internal/modules/cjs/loader.js:863:32)\\n at Function.Module._load (internal/modules/cjs/loader.js:708:14)\\n at Function.t._load (/usr/lib/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:1065:961)\\n at Function.i._load (/usr/lib/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:1035:665)\\n at Module.require (internal/modules/cjs/loader.js:887:19)\\n at require (internal/modules/cjs/helpers.js:74:18)\\n at bindings (/usr/lib/node_modules/code-server/lib/vscode/node_modules/bindings/bindings.js:112:48)\\n at Object.<anonymous> (/usr/lib/node_modules/code-server/lib/vscode/node_modules/spdlog/index.js:3:35)\\n at Module._compile (internal/modules/cjs/loader.js:999:30)\\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)\\n at Module.load (internal/modules/cjs/loader.js:863:32)\\n at Function.Module._load (internal/modules/cjs/loader.js:708:14)\\n at Function.t._load (/usr/lib/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:1065:961)\\n at Function.i._load (/usr/lib/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:1035:665)\\n at Module.require (internal/modules/cjs/loader.js:887:19)\\n at require (internal/modules/cjs/helpers.js:74:18)\\n at t.load (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:17:960)\\n at e.load (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:13:941)\\n at o (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:31:189)\\n at Object.errorback (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:31:313)\\n at e.triggerErrorback (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:14:306)\\n at /usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:14:10\\n at ReadFileContext.<anonymous> (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:18:342)\\n at ReadFileContext.callback (/usr/lib/node_modules/code-server/lib/vscode/node_modules/graceful-fs/graceful-fs.js:115:16)\\n at FSReqCallback.readFileAfterOpen [as oncomplete] (fs.js:261:13)\"]","token":"cc585d5e-035d-4875-9d18-cdd3e2a29183"}
innerError Error: Cannot find module '../build/Debug/pty.node'
Require stack:
- /usr/lib/node_modules/code-server/lib/vscode/node_modules/node-pty/lib/unixTerminal.js
- /usr/lib/node_modules/code-server/lib/vscode/node_modules/node-pty/lib/index.js
- /usr/lib/node_modules/code-server/lib/vscode/out/bootstrap-amd.js
- /usr/lib/node_modules/code-server/lib/vscode/out/vs/server/fork.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
at Function.Module._load (internal/modules/cjs/loader.js:667:27)
at Module.require (internal/modules/cjs/loader.js:887:19)
at Module.patchedRequire [as require] (/usr/lib/node_modules/code-server/lib/vscode/node_modules/diagnostic-channel/dist/src/patchRequire.js:14:46)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/usr/lib/node_modules/code-server/lib/vscode/node_modules/node-pty/lib/unixTerminal.js:31:15)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at Module.patchedRequire [as require] (/usr/lib/node_modules/code-server/lib/vscode/node_modules/diagnostic-channel/dist/src/patchRequire.js:14:46)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/usr/lib/node_modules/code-server/lib/vscode/node_modules/node-pty/lib/index.js:14:20)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at Module.patchedRequire [as require] (/usr/lib/node_modules/code-server/lib/vscode/node_modules/diagnostic-channel/dist/src/patchRequire.js:14:46)
at require (internal/modules/cjs/helpers.js:74:18)
at t.load (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:17:960)
at e.load (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:13:941)
at o (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:31:189)
at Object.errorback (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:31:313)
at e.triggerErrorback (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:14:306)
at /usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:14:10
at ReadFileContext.callback (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:18:342)
at FSReqCallback.readFileAfterOpen [as oncomplete] (fs.js:261:13) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/usr/lib/node_modules/code-server/lib/vscode/node_modules/node-pty/lib/unixTerminal.js',
'/usr/lib/node_modules/code-server/lib/vscode/node_modules/node-pty/lib/index.js',
'/usr/lib/node_modules/code-server/lib/vscode/out/bootstrap-amd.js',
'/usr/lib/node_modules/code-server/lib/vscode/out/vs/server/fork.js'
]
}
PROTOCOL CORRUPTION, LAST SAW MSG 0 AND HAVE NOW RECEIVED MSG 38
I solved this entirely by accident, by being accommodating to external developers. The error is misleading, implying the nonexistence of needed libraries, but it assumes bash is installed.
Either install bash or add a terminal profile for ash in Settings, then use it as your terminal shell.

The element to find the link does not work instead browser.driver.findElement works

The login page of my app is not built with angular, but after the login, the pages that its lands and remaining app is built with angularjs.
To get the url I used browser.driver.get('//appurl'); which works fine.
After the login, element(by.css('a[href="#!/test"]')).click(); does not work, where as browser.driver.findElement(by.css('a[href="#!/test"]')).click(); worked !!
Below is the error
ScriptTimeoutError: script timeout: result was not received in 11
seconds
(Session info: chrome...
(Driver info: ...,...)
at Object.checkLegacyResponse (C:\Users\testuser\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\error.js:546:15)
at parseHttpResponse (C:\Users\testuser\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\http.js:509:13)
at doSend.then.response (C:\Users\testuser\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\http.js:441:30)
at process._tickCallback (internal/process/next_tick.js:68:7)
From: Task: Protractor.waitForAngular() - Locator: By(css selector, a[href="#!/workpieces"])
at thenableWebDriverProxy.schedule (C:\Users\testuser\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver.js:807:17)
at ProtractorBrowser.executeAsyncScript_ (C:\Users\testuser\AppData\Roaming\npm\node_modules\protractor\built\browser.js:425:28)
at angularAppRoot.then (C:\Users\testuser\AppData\Roaming\npm\node_modules\protractor\built\browser.js:456:33)
at ManagedPromise.invokeCallback_
(C:\Users\testuser\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:1376:14)
at TaskQueue.execute_ (C:\Users\testuser\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:3084:14)
at TaskQueue.executeNext_ (C:\Users\testuser\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:3067:27)
at asyncRun (C:\Users\testuser\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2927:27)
at C:\Users\testuser\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:668:7
at process._tickCallback (internal/process/next_tick.js:68:7)Error
at ElementArrayFinder.applyAction_ (C:\Users\testuser\AppData\Roaming\npm\node_modules\protractor\built\element.js:459:27)
at ElementArrayFinder.(anonymous function).args [as click] (C:\Users\testuser\AppData\Roaming\npm\node_modules\protractor\built\element.js:91:29)
at ElementFinder.(anonymous function).args [as click] (C:\Users\testuser\AppData\Roaming\npm\node_modules\protractor\built\element.js:831:22)
at UserContext. (C:\Users\testuser\repos\test\spec.js:21:53)
at C:\Users\testuser\AppData\Roaming\npm\node_modules\protractor\node_modules\jasminewd2\index.js:112:25
at new ManagedPromise (C:\Users\testuser\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:1077:7)
at ControlFlow.promise (C:\Users\testuser\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2505:12)
at schedulerExecute (C:\Users\testuser\AppData\Roaming\npm\node_modules\protractor\node_modules\jasminewd2\index.js:95:18)
at TaskQueue.execute_ (C:\Users\testuser\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:3084:14)
at TaskQueue.executeNext_ (C:\Users\testuser\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:3067:27)
From: Task: Run it("Test") in control flow
at UserContext. (C:\Users\testuser\AppData\Roaming\npm\node_modules\protractor\node_modules\jasminewd2\index.js:94:19)
From asynchronous test:
Error
at Suite. (C:\Users\testuser\repos\test\spec.js:20:5)
at Object. (C:\Users\testuser\repos\test\spec.js:1:63)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)

Error: listen EADDRINUSE when using nodemon with babel 7

nodemon -v: 1.18.6
node -v: v11.2.0
Command: nodemon --exec babel-node lib/server.js
My app starts ok with the above command. When I change the source code, I expect the nodemon restart automatically. But I got the error Error: listen EADDRINUSE: address already in use :::3000.
Error details
[nodemon] starting `babel-node lib/server.js`
events.js:167
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE: address already in use :::3000
at Server.setupListenHandle [as _listen2] (net.js:1294:14)
at listenInCluster (net.js:1342:12)
at Server.listen (net.js:1429:7)
at Function.listen (/Users/longntran/Desktop/learning/pangara-web/node_modules/express/lib/application.js:618:24)
at Object.listen (/Users/longntran/Desktop/learning/pangara-web/lib/server.js:12:5)
at Module._compile (internal/modules/cjs/loader.js:722:30)
at Module._compile (/Users/longntran/Desktop/learning/pangara-web/node_modules/pirates/lib/index.js:83:24)
at Module._extensions..js (internal/modules/cjs/loader.js:733:10)
at Object.newLoader [as .js] (/Users/longntran/Desktop/learning/pangara-web/node_modules/pirates/lib/index.js:88:7)
at Module.load (internal/modules/cjs/loader.js:620:32)
Emitted 'error' event at:
at emitErrorNT (net.js:1321:8)
at internalTickCallback (internal/process/next_tick.js:72:19)
at process._tickCallback (internal/process/next_tick.js:47:5)
at Function.Module.runMain (internal/modules/cjs/loader.js:778:11)
at Object.<anonymous> (/Users/longntran/Desktop/learning/pangara-web/node_modules/#babel/node/lib/_babel-node.js:224:23)
at Module._compile (internal/modules/cjs/loader.js:722:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:733:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
at Function.Module._load (internal/modules/cjs/loader.js:552:3)
Dependencies
"dependencies": {
"ejs": "^2.6.1",
"express": "^4.16.4",
"react": "^16.6.3",
"react-dom": "^16.6.3"
},
"devDependencies": {
"#babel/core": "^7.1.6",
"#babel/preset-env": "^7.1.6",
"#babel/preset-react": "^7.0.0",
"#babel/node": "^7.0.0",
"babel-jest": "^23.6.0",
"babel-loader": "^8.0.4",
"jest": "^23.6.0",
"nodemon": "^1.18.6",
"pm2": "^3.2.2",
"prettier": "1.15.2",
"regenerator-runtime": "^0.13.1",
"webpack": "^4.26.1",
"webpack-cli": "^3.1.2"
}
Note
I am using nodemon with babel 7. Please help me. Thank you guys
I found an interesting fix in this thread around adding a delay and kill process commands to your scripts.
"events": {
"restart": "fuser -k 5000/tcp ; fuser -k 3050/tcp" // change to whatever ports you're using.
}
And to add a delay to the nodemon command:
--delay 1500ms
https://github.com/remy/nodemon/issues/1316#issuecomment-387367160
I also noticed that if I hit save twice in my code editor in rapid succession, I get this error. However if I only hit save once, I see no problem.
I've found that completing a graceful server shutdown on any interruption allows nodemon to restart successfully (using Express):
// Run server
const PORT = process.env.PORT || 3000
const server = app.listen(PORT, () => {
console.log('[server] Started server');
});
// Graceful shutdown of server
process.on('SIGINT', () => {
console.log('\n[server] Shutting down...');
server.close();
process.exit();
});
process.on('SIGTERM', () => {
console.log('\n[server] Shutting down...');
server.close();
process.exit();
});
process.on('uncaughtException', () => {
console.log('\n[server] Shutting down...');
server.close();
process.exit();
});

Getting error "Failed: Fn is not a function" when try to automate e2e for a login page

I am trying to automate and rum a simple register form but i am getting error saying "Failed: Fn is not a function". Below is my code
describe('Locator testing by model', function(){
it('automate user register form', function(){
browser.get('http://www.way2automation.com/angularjs-protractor/registeration/#/login');
element(by.model('Auth.user.name')).sendKeys('angular');
element(by.model('Auth.user.password')).sendKeys('password');
element(by.model('model[options.key]')).sendKeys('zafaque');
element(by.buttonText('Login')).click();
browser.wait(3000);
});
});
below is the error detail
1) Locator testing by model automate user register form
Message:
Failed: fn is not a function
Stack:
TypeError: fn is not a function
at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:716:14
at TaskQueue.execute_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2913:14)
at TaskQueue.executeNext_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2896:21)
at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2820:25
at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:639:7
at process._tickCallback (node.js:369:9)
From: Task: <anonymous>
at pollCondition (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2359:16)
at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2355:9
at new ManagedPromise (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:1082:7)
at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2354:14
at TaskQueue.execute_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2913:14)
at TaskQueue.executeNext_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2896:21)
at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2775:27
at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:639:7
at process._tickCallback (node.js:369:9)
From: Task: <anonymous wait>
at ControlFlow.wait (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2352:17)
at Driver.wait (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:712:29)
at ProtractorBrowser.to.(anonymous function) [as wait] (/usr/local/lib/node_modules/protractor/built/browser.js:60:29)
at Object.<anonymous> (/Users/zafaque/WebstormProjects/autotation/udemyProject/loginTest.js:12:17)
at /usr/local/lib/node_modules/protractor/node_modules/jasminewd2/index.js:94:23
at new ManagedPromise (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:1082:7)
at controlFlowExecute (/usr/local/lib/node_modules/protractor/node_modules/jasminewd2/index.js:80:18)
at TaskQueue.execute_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2913:14)
at TaskQueue.executeNext_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2896:21)
at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2820:25
From: Task: Run it("automate user register form") in control flow
at Object.<anonymous> (/usr/local/lib/node_modules/protractor/node_modules/jasminewd2/index.js:79:14)
From asynchronous test:
Error
at Suite.<anonymous> (/Users/zafaque/WebstormProjects/autotation/udemyProject/loginTest.js:6:5)
at Object.<anonymous> (/Users/zafaque/WebstormProjects/autotation/udemyProject/loginTest.js:4:1)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
You are using browser.wait() incorrectly. Refer the official documentation for correct usage here
browser.wait() accepts params in the below order
first argument is a condition which can be a function or a
webdriver.promise.Promise or a Expected Condition Second Argument is
the timeout
But you are passing timeout as the first argument. Incase you just wait a conditionless wait - Just use browser.sleep(3000)

protractor sets error without opening browser

i download a new ionic project and i am trying to test the header contains these elements ""
my config file is
exports.config = {
framework: 'jasmine2',
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['../www/head.spec.js'],
multiCapabilities: [
{
browserName: 'chrome'
}]
}
named this as e2e.js
my test case file is
describe('header Module', function(){
var header;
beforeEach(function() {
header = element(by.css('title'));
});
it('should check title text',function(){
expect(header.getText()).toContain('Ionic Blank Starter');
});
});
and i named this as head.spec.js
my issue is that i could see the browser opened and my protractor sends an error msg
empresss-Mac-mini:myApp admin$ protractor test/e2e.js
Using the selenium server at http://localhost:4444/wd/hub
[launcher] Running 1 instances of WebDriver
/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:172
callback(new Error(message));
^
Error: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:4444
at ClientRequest. (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:172:16)
at emitOne (events.js:77:13)
at ClientRequest.emit (events.js:169:7)
at Socket.socketErrorListener (_http_client.js:259:9)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at emitErrorNT (net.js:1253:8)
at doNTCallback2 (node.js:439:9)
at process.tickCallback (node.js:353:17)
From: Task: WebDriver.createSession()
at Function.webdriver.WebDriver.acquireSession (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:157:22)
at Function.webdriver.WebDriver.createSession (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:131:30)
at [object Object].Builder.build (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/builder.js:445:22)
at [object Object].DriverProvider.getNewDriver (/usr/local/lib/node_modules/protractor/lib/driverProviders/driverProvider.js:38:7)
at [object Object].Runner.createBrowser (/usr/local/lib/node_modules/protractor/lib/runner.js:182:37)
at /usr/local/lib/node_modules/protractor/lib/runner.js:263:21
at _fulfilled (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:797:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:826:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:759:13)
at /usr/local/lib/node_modules/protractor/node_modules/q/q.js:525:49
[launcher] Process exited with error code 1
could someone help to fix this issue
when i try to webdriver-manager update err msg is displayed
empresss-Mac-mini:~ admin$ webdriver-manager update
fs.js:799
return binding.mkdir(pathModule._makeLong(path),
^
Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/protractor/selenium'
at Error (native)
at Object.fs.mkdirSync (fs.js:799:18)
at Object.<anonymous> (/usr/local/lib/node_modules/protractor/bin/webdriver-manager:126:6)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:134:18)
at node.js:961:3
empresss-Mac-mini:~ admin$