I currently have a project which uses jasmine and selenium on top of node.js. Protractor provides some useful modules which I would like to use, so I installed it and tried to run it using "protractor conf.js". I ended up getting the following errors:
[15:55:03] E/direct - Error code: 135
[15:55:03] E/direct - Error message: Could not find update-config.json. Run 'webdriver-manager update'
to download binaries.
[15:55:03] E/direct - Error: Could not find update-config.json. Run 'webdriver-manager update' to down
load binaries.
When I try to run webdriver-manager update, I get this:
[15:46:10] I/file_manager - creating folder C:\Program Files\node-v8.1.0-win-x86\node_modules\protract
or\node_modules\webdriver-manager\selenium
events.js:182
throw er; // Unhandled 'error' event
I saw some other threads with similar errors but they didn't seem to work for me. I suspect that this might be related to the fact that I want to run protractor without AngularJS, but I'm not sure since I believed it was possible to run protractor without angular. Any help would be appreciated.
EDIT: I tried setting "proxy_on" and "npm config set strict-ssl false" but ended up getting the following when running webdriver-manager-update:
events.js:182 throw er; Unhandled 'error' event
Error: self signed certificate in certificate chain at TLSSocket. (_tls_wrap.js:1098:38) at emitNone (events.js:105:13) at TLSSocket.emit (events.js:207:7) at TLSSocket._finishInit (_tls_wrap.js:628:8) at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:458:38)
Edit 2: Using npm 5.0.3, node 8.1.0, webbdriver-manager 12.0.6, OS: Windows 7
Related
I am trying to build the next Js app production files to deploy it on cPanel, when I execute
npm run dev the app is working just fine but as I start to build a production file with the help of this video(https://youtu.be/1ykSXau838c) and executes npm run build it gives me an error in the terminal as given below:
PS C:\Users\hp\Desktop\reactJs-project\NextJs\test-app> npm run build
> test-app#0.1.0 build
> next build
info - Checking validity of types
info - Creating an optimized production build .node:events:368
throw er; // Unhandled 'error' event
^
Error: EPERM: operation not permitted, open 'C:\Users\hp\Desktop\reactJs-project\NextJs\test-app\.next\trace'
Emitted 'error' event on WriteStream instance at:
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -4048,
code: 'EPERM',
syscall: 'open',
path: 'C:\\Users\\hp\\Desktop\\reactJs-project\\NextJs\\test-app\\.next\\trace'
}
so I just want to know is there any way to solve this problem?
Posting comment from Koronag as an answer (as it helped me with this error and seems the most likely cause)...
This error is commonly seen when running a build while the dev server is already running. (E.g. in my case, I had a local build running via npm run dev and was trying to commit/push code, which invoked a Git Hook that also runs npm run dev.)
For me, it works fine this answer drives me to the resolver.
I run 2 scripts in terminals:
once for development
another for the build process.
So after killing the development script it looks perfectly fine!
From next-sitemap repo README.md
"Having next-sitemap command & next-sitemap.js file may result in file opening instead of building sitemaps in windows machines.
As a solution to this, it is now possible to use a custom config file instead of next-sitemap.js. Just pass --config .js to build command."
Next-Sitemap README.md - Building Sitemaps
The above worked for me
I am trying to use Protractor on a baseline run of the Angular Quickstart Seed.
However, when I run Protractor, or simply try to update the webdriver myself I get the following output:
[11:31:24] I/file_manager - creating folder C:\Users\davidtaylorjr\devbox\home\angula
r2-fundamentals\node_modules\protractor\node_modules\webdriver-manager\selenium
events.js:161
throw er; // Unhandled 'error' event
^
Error: unable to verify the first certificate
at TLSSocket.<anonymous> (_tls_wrap.js:1085:38)
at emitNone (events.js:86:13)
at TLSSocket.emit (events.js:186:7)
at TLSSocket._finishInit (_tls_wrap.js:603:8)
at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:433:38)
I have not modified any of the files and they are the files that are available in the Angular Quickstart
The software is having a conflict with current network settings and SSL Certificate Verification.
Protractor and Web-Driver have a way to deal with this by setting a flag on your update command. The command set should be as follows:
webdriver-manager update --ignore_ssl
This will allow you to update without being flagged with SSL errors.
This should only be used if other methods of working with SSL fails.
Webdriver-manager on update downloads some drivers/jars from the below sources. Looks like there is some issue during this. Can you manually download and verify if you are able to access the below url's
Sources: from webdriver-manager configs
"cdnUrls": {
"selenium": "https://selenium-release.storage.googleapis.com/",
"chromedriver": "https://chromedriver.storage.googleapis.com/",
"geckodriver": "https://github.com/mozilla/geckodriver/releases/download/",
"iedriver": "https://selenium-release.storage.googleapis.com/",
"androidsdk": "http://dl.google.com/android/"
}
I'm bringing this into discussion here, since I had started this conversation over GithubIssue 2630, Basically I'm having problems with the integration of Protractor and Cucumber, I had even tried to downgrade to a older versions for both but the same thing happens, here's an explanation of what I did so far:
I had uninstalled everything and started from scratch. I started by installing Protractor, Cucumber and Webdriver globally and I can see this error, same as before, when I run the protractor command.
$ protractor conf.js
Starting selenium standalone server...
[launcher] Running 1 instances of WebDriver
Selenium standalone server started at http://192.168.0.104:64737/wd/hub
[launcher] Error: TypeError: undefined is not a function
at /usr/local/lib/node_modules/protractor/lib/frameworks/cucumber.js:150:36
at Function.promise (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:650:9)
at /usr/local/lib/node_modules/protractor/lib/frameworks/cucumber.js:147:14
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
at flush (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:355:11)
[launcher] Process exited with error code 100
```
Then I've installed all locally, running npm install, and I got this error
[launcher] Process exited with error code 1
/Users/brunosoko/Documents/Dev/Personal/test2/node_modules/protractor/node_modules/q/q.js:126
throw e;
^
Error: No selenium server jar found at the specified location (/Users/brunosoko/Documents/Dev/Personal/test2/node_modules/protractor/selenium/selenium-server-standalone-2.47.1.jar). Check that the version number is up to date.
at LocalDriverProvider.addDefaultBinaryLocs_ (/Users/brunosoko/Documents/Dev/Personal/test2/node_modules/protractor/lib/driverProviders/local.js:37:11)
at LocalDriverProvider.setupEnv (/Users/brunosoko/Documents/Dev/Personal/test2/node_modules/protractor/lib/driverProviders/local.js:71:8)
at Runner.run (/Users/brunosoko/Documents/Dev/Personal/olapic-test2/node_modules/protractor/lib/runner.js:261:31)
at TaskRunner.run (/Users/brunosoko/Documents/Dev/Personal/test2/node_modules/protractor/lib/taskRunner.js:123:19)
at createNextTaskRunner (/Users/brunosoko/Documents/Dev/Personal/test2/node_modules/protractor/lib/launcher.js:223:20)
at /Users/brunosoko/Documents/Dev/Personal/test2/node_modules/protractor/lib/launcher.js:246:7
at _fulfilled (/Users/brunosoko/Documents/Dev/Personal/test2/node_modules/protractor/node_modules/q/q.js:797:54)
at self.promiseDispatch.done (/Users/brunosoko/Documents/Dev/Personal/test2/node_modules/protractor/node_modules/q/q.js:826:30)
at Promise.promise.promiseDispatch (/Users/brunosoko/Documents/Dev/Personal/test2/node_modules/protractor/node_modules/q/q.js:759:13)
at /Users/brunosoko/Documents/Dev/Personal/test2/node_modules/protractor/node_modules/q/q.js:573:44
Which I resolved by installing locally webdriver ./node_modules/.bin/webdriver-manager update
Then I ran ./node_modules/.bin/protractor conf.js and I'm getting the same error as above, for cucumber.js:150:36
Later, I tried to uninstall globally framework, npm uninstall -g protractor and npm uninstall -g cucumber
But the same error happens! I'm not sure what am I doing wrong!
I'm not sure what is wrong with your specific situation, but I have created a bare minimum example of cucumber 0.8.1 working with the yet to be released version of protractor here - https://github.com/darrinholst/protractor-cucumber-example. Hope this helps.
git clone https://github.com/darrinholst/protractor-cucumber-example
cd protractor-cucumber-example
npm install
npm test
I am following along with TutsPlus Real time web apps with angularjs and firebase.
Referring to https://github.com/yeoman/generator-angular I ran
npm install -g grunt bower yo generator-karma generator-angular
After that I made a new project directory , cd into it and ran
yo angular which gave the following error:
events.js:85
throw er; // Unhandled 'error' event
^
Error: spawn grunt ENOENT
at exports._errnoException (util.js:746:11)
at Process.ChildProcess._handle.onexit (child_process.js:1046:32)
at child_process.js:1137:20
at process._tickCallback (node.js:355:11)
I have searched for ages now and can't find the specific reason for the error.
If someone could point me in the right direction please..
Thanks.
link to full output http://pastebin.com/GqJQV1Dg
I am facing a problem when starting webdriver-manager in node_modules\protractor with windows 7. the command is :
node webdriver-manager start
Then I got the following error messages:
seleniumProcess.pid: undefined
events.js:85
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at exports._errnoException (util.js:742:11)
at Process.ChildProcess._handle.onexit (child_process.js:1028:32)
at child_process.js:1109:20
at process._tickCallback (node.js:343:11)
at Function.Module.runMain (module.js:492:11)
at startup (node.js:124:16)
at node.js:807:3
After searching on the Internet, I cannot find any similar question like mine that the seleniumProcess.pid is undefined.
Following is the output for java -version:
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
Any idea?
Ok, I figured out why I had this problem. You have only JRE, but
You will need to have the Java Development Kit (JDK) installed to run
the standalone Selenium Server. Check this by running java -version
from the command line. Tutorial
On Ubuntu I've done
$ sudo apt-get install openjdk-7-jdk
And now I have this Java:
$ java -version
java version "1.7.0_95"
OpenJDK Runtime Environment (IcedTea 2.6.4) (7u95-2.6.4-0ubuntu0.15.10.1)
OpenJDK 64-Bit Server VM (build 24.95-b01, mixed mode)
And webdriver-manager start works.
Error:
C:\XXXX\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriv
er-manager\bin>webdriver-manager --verbose update
events.js:160
throw er; // Unhandled 'error' event
^
Error: unable to verify the first certificate
at Error (native)
at TLSSocket. (_tls_wrap.js:1092:38)
at emitNone (events.js:86:13)
at TLSSocket.emit (events.js:185:7)
at TLSSocket._finishInit (_tls_wrap.js:610:8)
at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:440:38)
I did the following to remove this:
Try:
1. C:\XX\Roaming\npm\node_modules\protractor\node_modules\webdriv
er-manager\bin>webdriver-manager --proxy http://username:passwd#IP:port
080/ update
(Then it updated drivers in the location)
webdriver-manager status
C:\XX\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriver-manager\bin>webdriver-manager --verbose start
It is started working,
I expect this is happening repeatedly due to corruption of drivers. May we need to graceful stop to work.
Try to add C:\Windows\System32\ there (right-click My Computer -> Properties -> Advanced system settings -> Environment Variables -> Edit... PATH and add C:\Windows\System32 to the end (with a semi-colon separating each variable).