Error while running conf.js file from Eclipse - protractor

I am starting to use protractor using eclipse, configured everything, nodejs, protractor, webdriver, but while running protractor with eclipse I am facing below issue with protractor.
Can someone please help me.
Environment details:
C:\Users\User>protractor --version
Version 5.1.1
C:\Users\User>npm --version
3.10.10
C:\Users\User>npm-windows-upgrade
'npm-windows-upgrade' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\User>node -v
v6.10.3
Error facing
**C:\Users(user)\AppData\Roaming\npm\node_modules\webdriver-manager\built\lib\cli\logger.js:66
info(...msgs) {
^^^
SyntaxError: Unexpected token ...
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (C:\Users(user)\AppData\Roaming\npm\node_modules\we
bdriver-manager\built\lib\cli\index.js:8:10)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)**

The error suggests that there is a error in parsing the Javascript of webdriver-manager. webdriver-manager was updated to ES6 (and that's why we need Node 6+) and threw the ... errors in the past for older version of node.
Based on that I would say that Eclipse is running on an older version. After searching the webdriver-manager git I found this issue. I think it matches your problem and also gives you the steps to check which version of node Eclipse is using.
Hope it helps

Related

Can't use shell command with VSCode anymore

Super strange thing just happened. In the middle of my project running, it crashed and I was left with this error:
Error: EPERM: operation not permitted, uv_cwd
at process.wrappedCwd [as cwd] (node:internal/bootstrap/switches/does_own_process_state:126:28)
...
All of the files on the lefthand side of the editor disappeared. Was just weird, so I closed VS Code and navigated to the folder and used the code . shell command to open it up again as I normally would; however, this error again.
It literally came out of nowhere - I ran my program, got up to grab my coffee, came back 2 minutes later and was left with this. I have already tried:
Uninstalling and reinstalling VS Code
Running npm cache clean with the --force flag.
No luck though. Anyone have any ideas? I can't find anything online.
Edit:
It's happening again. I'm once again trying to run code . within a project's directory in order to open it in VSCode. Here's the error's full stack trace:
Error: EPERM: operation not permitted, uv_cwd
at process.wrappedCwd [as cwd] (node:internal/bootstrap/switches/does_own_process_state:126:28)
at setupCurrentWorkingDirectory (/Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap-node.js:1:155)
at Object.<anonymous> (/Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap-node.js:1:260)
at Module._compile (node:internal/modules/cjs/loader:1163:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1216:10)
at Module.load (node:internal/modules/cjs/loader:1035:32)
at Module._load (node:internal/modules/cjs/loader:876:12)
at Function.c._load (node:electron/js2c/asar_bundle:5:13343)
at Module.require (node:internal/modules/cjs/loader:1059:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/Applications/Visual Studio Code.app/Contents/Resources/app/out/cli.js:1:97)
at Module._compile (node:internal/modules/cjs/loader:1163:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1216:10)
at Module.load (node:internal/modules/cjs/loader:1035:32)
at Module._load (node:internal/modules/cjs/loader:876:12)
at Function.c._load (node:electron/js2c/asar_bundle:5:13343)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47 {
errno: -1,
code: 'EPERM',
syscall: 'uv_cwd'
}
The project's folder (foo-bar) lives in a folder called (let's say) FizzBuzz on my desktop. From my desktop, I can run code FizzBuzz/foo-bar and it'll open the project just file. The error above occurs when I try to run cd FizzBuzz/foo-bar && code .
It's a long shot, but since you're probably using MacOS, it could very well be related to an anti virus. Seems plausible for your case as it's coming completely out of the blue.
If you use && in bash, it spawns the process in a different way than using code . standalone. So it's possibly flagged as dangerous only with && by anti virus, which might explain the difference you're observing in your edit.
Keep in mind that there is a chance you actually have a malicious package installed and it's rightly being picked up. A small chance, but malicious packages do exist on NPM. These recent discoveries might also have resulted in more anti virus rules and scanning of JS packages, which in turn make false positives more likely.
On a similar question there are also reports of this as a cause.
If it's not related to that, the question has plenty other answers you can try.
You didn't mention whether you tried rebooting. Since you updated the question saying "it's back", I assume it just stopped occurring previously. When did it do so? Was if after a reboot?
I had a similar issue recently but after winding about for a while I realized this; I was running the npm start command from the bin directory. This happens when you delete a very valuable file and somehow the package manager searches the bin for the file. To resolve this try to change the directory into your working folder and make sure you've got all the necessary files available ie the index.js etc. It should work from here on end.

On any of my Heroku apps, several `heroku pg:` commands fail immediately with "Cannot read property 'includes' of undefined." [duplicate]

I'm trying to use the Heroku cli "keys" functions to upload a ssh key to my account. Unfortunately I run into the following error whenever I try to use any of the keys methods.
TypeError: Cannot read property 'run' of undefined
at Object.<anonymous> (C:\Users\Administrator\AppData\Local\heroku\tmp\heroku-script-292666295:14: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 Function.Module.runMain (module.js:575:10)
at startup (node.js:159:18)
at node.js:444:3
Any thoughts would be greatly appreciated.
After speaking with the Heroku support team we found that heroku update fixed the problem.
It seems, Heroku command facing trouble finding right version of ruby so its throwing the error.
Uninstall Heroku Toolbelt through Windows "Control Panel\Programs and Features" after successful uninstallation, delete C:\Program Files\Heroku folder as well.
And then reinstall Heroku Toolbelt and try to run the command. It should work.
I removed this folder and all was well C:\Users\USERNAME.heroku.npm-cache
Updating your package.json with the Node version you are using may fix this:
"engines": {
"node": "6.0.0"
},
I was using version 6.0.0 locally, but Heroku was downloading version 5.11.1.
I solve this error unstalling node.js from windows and removing the content of heroku folder(in appdata), after that typed on the propty: heroku --version. heroku said me to update git to other version, I updated it. then I run the command to generate a key again and worked perfectly. This worked to me.

Cloud Function Deployment - TypeError: instance.INTERNAL.registerComponent is not a function

I'm getting this error when I try to deploy Cloud Functions. Have tried with firebase-admin 8.8.0, 8.7.0, and 8.6.1 (the last 3 versions)
Running firebase-functions 3.3.0
Any idea what the problem is? Anyone else have this issue?
Error: Error occurred while parsing your function triggers.
TypeError: instance.INTERNAL.registerComponent is not a function
at registerDatabase (/PATH/cloud-functions/functions/node_modules/firebase-admin/node_modules/#firebase/database/dist/index.node.cjs.js:15165:39)
at Object.<anonymous> (/PATH/cloud-functions/functions/node_modules/firebase-admin/node_modules/#firebase/database/dist/index.node.cjs.js:15196:5)
at Module._compile (internal/modules/cjs/loader.js:721:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:732: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)
at Module.require (internal/modules/cjs/loader.js:657:17)
at require (internal/modules/cjs/helpers.js:22:18)
at FirebaseNamespace.get [as database] (/PATH/cloud-functions/functions/node_modules/firebase-admin/lib/firebase-namespace.js:282:38)
instance.INTERNAL.registerComponent
resides inside firebase/app library
So running npm install #firebase/app --save fixes the issue
In my case, I already had #firebase/app as part of firebase. I also have node 12 installed with Win 10
npm ls #firebase/app
functions# C:\Users\me\source\repos\admin\functions
`-- firebase#5.2.4
`-- #firebase/app#0.6.13
I fixed the issue by updating the firebase dependencies to the latest.
npm i --save firebase#latest firebase-admin#latest firebase-functions#latest
From my package.json:
"firebase": "^8.2.4",
"firebase-admin": "^9.4.2",
"firebase-functions": "^3.13.1",
Note:
Always update firebase-tool to the latest:
npm i -g firebase-tools#lates
Solved on Github. Was a bug in Firebase
https://github.com/firebase/firebase-admin-node/issues/714
https://github.com/firebase/firebase-admin-node/issues/717

#babel/preset-env loaded with wrong babel version after upgrade babel 6 to 7

I tried to upgrade my babel from 6 to 7, but I encounter this issue.
/Users/darryl/Documents/Github/apps/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:328
throw e;
^
Error: Requires Babel "^7.0.0-0", but was loaded with "6.26.3". If you are sure you have a compatible version of #babel/core, it is likely that something in your build process is loading the wrong version. Inspect the stack trace of this error to look for the first entry that doesn't mention "#babel/core" or "babel-core" to see what is calling Babel. (While processing preset: "/Users/darryl/Documents/Github/apps/node_modules/#babel/preset-env/lib/index.js")
at throwVersionError (/Users/darryl/Documents/Github/apps/node_modules/#babel/preset-env/node_modules/#babel/helper-plugin-utils/lib/index.js:65:11)
at Object.assertVersion (/Users/darryl/Documents/Github/apps/node_modules/#babel/preset-env/node_modules/#babel/helper-plugin-utils/lib/index.js:13:11)
at _default (/Users/darryl/Documents/Github/apps/node_modules/#babel/preset-env/lib/index.js:154:7)
at /Users/darryl/Documents/Github/apps/node_modules/#babel/preset-env/node_modules/#babel/helper-plugin-utils/lib/index.js:19:12
at /Users/darryl/Documents/Github/apps/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:317:46
at Array.map (<anonymous>)
at OptionManager.resolvePresets (/Users/darryl/Documents/Github/apps/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:275:20)
at OptionManager.mergePresets (/Users/darryl/Documents/Github/apps/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:264:10)
at OptionManager.mergeOptions (/Users/darryl/Documents/Github/apps/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:249:14)
at OptionManager.init (/Users/darryl/Documents/Github/apps/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
at compile (/Users/darryl/Documents/Github/apps/node_modules/babel-register/lib/node.js:103:45)
at loader (/Users/darryl/Documents/Github/apps/node_modules/babel-register/lib/node.js:144:14)
at Object.require.extensions.(anonymous function) [as .js] (/Users/darryl/Documents/Github/apps/node_modules/babel-register/lib/node.js:154:7)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Function.Module.runMain (module.js:684:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
Can someone help to explain what had happened?
I tried to remove node_modules and package-lock.json, and also run npm cache clean --force
But this error still occured.
How to force this dependency (#babel/preset-env) to use Babel 7 in their dependency instead of Babel 6.26.3?
As mentioned by loganfsmyth, do
npm i -D #babel/register
help me to solve the issue I encounter about this babel-register dependency that still using Babel version 6.

Getting error while trying to debug vscode source from vsode - Error: Cannot find module 'winreg'

I am trying to debug vscode source code from vscode itself. While I am trying to debug from the 'Launch VS Code' and press F5, it gives the following error.
Loading "winreg" failed
loader.js:224
Error: Cannot find module 'winreg'
loader.js:227
at Module._resolveFilename (module.js:470:15)
at Function.Module._resolveFilename (c:\Users\oguz\Documents\workspace\vscode\.build\electron\resources\electron.asar\common\reset-search-paths.js:35:12)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at nodeRequire (file:///C:/Users/oguz/Documents/workspace/vscode/out/vs/loader.js:1642:28)
at NodeScriptLoader.load (file:///C:/Users/oguz/Documents/workspace/vscode/out/vs/loader.js:703:39)
at OnlyOnceScriptLoader.load (file:///C:/Users/oguz/Documents/workspace/vscode/out/vs/loader.js:549:37)
at loadNextPath (file:///C:/Users/oguz/Documents/workspace/vscode/out/vs/loader.js:1401:41)
at Object.errorback (file:///C:/Users/oguz/Documents/workspace/vscode/out/vs/loader.js:1409:25)
Detail:
loader.js:225
Error: Cannot find module 'winreg'
loader.js:225
Here are the modules that depend on it:
Array(1) ["vs/platform/telemetry/node/workbenchCommonProperti…"]
I've found my own solution. Npm requires winreg module but it could not find it. So, I installed it manually by npm install winreg command. Now I can debug vscode.
https://www.npmjs.com/package/winreg