grunt "Error: Cannot find module '../time/convert' (only on windows) - windows

Setup a new angular project under linux. Committed it to git and cloned it to windows. Using bower and npm, I managed to get everything loaded, except, I have this one error (only on windows)
A recursive grep for ../time/convert in the project shows me:
./node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/diff.js:var convert = require('../time/convert');
./node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/diff.js:define(['./totalDaysInMonth', './totalDaysInYear', '../time/convert'], function(totalDaysInMonth, totalDaysInYear, convert){
./node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/diff.js:var convert = require('../time/convert');
./node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/diff.js:var convert = require('../time/convert');
./node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/diff.js:define(['./totalDaysInMonth', './totalDaysInYear', '../time/conve
but ls -l shows:
$ ls ./node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/time
convert.js now.js parseMs.js toTimeString.js
Which says that convert.js is actually there. Being new to grunt and angular, I'm puzzled where this could be coming from and how to troubleshoot it.
After this I end up getting stuck here:
Running "karma:unit" (karma) task
INFO [karma]: Karma v0.10.4 server started at http://localhost:8080/
INFO [launcher]: Starting browser Chrome
WARN [watcher]: Pattern ".../test/mock/**/*.js" does not match any file
WARN [launcher]: Chrome have not captured in 60000 ms, killing.
INFO [launcher]: Trying to start Chrome again.
WARN [launcher]: Chrome have not captured in 60000 ms, killing.
INFO [launcher]: Trying to start Chrome again.
Wondering if angular work using grunt is just not possible on Windows....

My solution was to quit using windows. Moved dev work to linux, and no more crazy problems like this. Oh, and my machine now seems a good deal faster too.

Related

WebdriverIO: couldn't find executable for firefox browser using default runner (devtools:puppeteer)

I'm using webdriverIO for some automation testing and have recently migrated from 'selenium-standalone' service to default wdio devtools protocol.
wdio v.7.16.12
firefox v.95.0.2
From that point I can't start testing with firefox browser:
INFO #wdio/cli:launcher: Run onPrepare hook
INFO #wdio/cli:launcher: Run onWorkerStart hook
INFO #wdio/local-runner: Start worker 0-0 with arg: run,wdio.conf.js
INFO #wdio/local-runner: Run worker command: run
...
INFO devtools:puppeteer: Initiate new session using the DevTools protocol
ERROR #wdio/runner: Error: Couldn't find executable for browser
...
INFO #wdio/cli:launcher: Run onComplete hook
I've tried different combinations of options with 'wdio:devtoolsOptions' and 'moz:firefoxOptions'.
Plus checked whether could help dumpio: true, and 'moz:debuggerAddress': true options.
Also I've tried substitution browserName with product and adding binary and executablePath to capabilities.
When passing binary: 'path.to.firefox' to 'moz:firefoxOptions' options, the error message changes to:
ERROR #wdio/runner: Error: Only Nightly release channel is supported in Devtools/Puppeteer for Firefox. Refer to the following issue:
...
Any ideas how it could be fixed in webdriverIO (without installing separately puppeteer or puppeteer-firefox)?
Thanks!
Seems that I took desired for real.
wdio + devtools:puppeteer still work with Firefox Nightly only – https://github.com/webdriverio/webdriverio/discussions/7916

Visual Studio Team Services and Karma

Any idea how you can run Karma unit tests inside VSTS? Do they have to be integrated with the Visual Studio Test Runner or is there a better way?
The project is purely client-side static SPA website so it has no Visual Studio solution or project.
Also It seems like even when I try to run Karma via NPM it seems like PhantomJS refuses to start on the Agent.
Logs from the Build:
2016-08-03T02:45:44.9647601Z webpack: bundle is now VALID.
2016-08-03T02:45:44.9717626Z [32m03 08 2016 02:45:44.968:INFO [karma]: [39mKarma v0.13.22 server started at http://localhost:9876/
2016-08-03T02:45:44.9767811Z [32m03 08 2016 02:45:44.976:INFO [launcher]: [39mStarting browser PhantomJS
2016-08-03T02:46:44.9784272Z [33m03 08 2016 02:46:44.977:WARN [launcher]: [39mPhantomJS have not captured in 60000 ms, killing.
2016-08-03T02:46:46.9783856Z [33m03 08 2016 02:46:46.977:WARN [launcher]: [39mPhantomJS was not killed in 2000 ms, sending SIGKILL.
2016-08-03T02:46:48.9792421Z [33m03 08 2016 02:46:48.978:WARN [launcher]: [39mPhantomJS was not killed by SIGKILL in 2000 ms, continuing.
2016-08-03T02:46:49.1602394Z npm ERR! Test failed. See above for more details.
2016-08-03T02:46:49.1722407Z ##[debug]rc:1
2016-08-03T02:46:49.1722407Z ##[debug]success:false
2016-08-03T02:46:49.1722407Z ##[debug]taskRunner fail
2016-08-03T02:46:49.1732408Z ##[debug]task result: Failed
2016-08-03T02:46:49.1782402Z ##[error]Npm failed with error: C:\Program Files\nodejs\npm.cmd failed with return code: 1
2016-08-03T02:46:49.1962405Z Finishing task: Npm
2016-08-03T02:46:49.2032405Z ##[error]System.Exception: Task Npm failed. This caused the job to fail. Look at the logs for the task for more details.
2016-08-03T02:46:49.2042402Z ##[error] at Microsoft.TeamFoundation.DistributedTask.Worker.JobRunner.Run(IJobContext jobContext, IJobRequest job, IJobExtension jobExtension, CancellationTokenSource tokenSource)
I'm not sure what is your configuration of steps, but it's works perfectly fine on my build definition.
Check also capabilities of your agent, should have node.js and npm capability.

phantomjs does not capture

I set up a standard yeoman/angular installation on Mac OS X 10.8.3 using npm. I created a new angular project using the yo generator. I installed phantomjs via npm install -g phantomjs. I configured karma to unly use phantomjs (all other browsers work fine). When running tests with grunt test, phantomjs does not capture at all, even if I set a very long timeout (50000ms). This is the log output:
Running "karma:unit" (karma) task
DEBUG [reporter]: Using reporter "progress".
INFO [karma]: Karma server started at http://localhost:8080/
INFO [launcher]: Starting browser PhantomJS
DEBUG [launcher]: Creating temp dir at /var/folders/6j/gz50dm2d3xv1hnz7s1t4lhn40000gp/T/testacular-79891032
DEBUG [launcher]: /usr/local/bin/phantomjs /var/folders/6j/gz50dm2d3xv1hnz7s1t4lhn40000gp/T/testacular-79891032/capture.js
WARN [watcher]: Pattern "/Users/alexanderwalter/Development/angularSeed/test/mock/**/*.js" does not match any file.
DEBUG [watcher]: Resolved files:
/Users/alexanderwalter/Development/angularSeed/node_modules/grunt-karma/node_modules/karma/adapter/lib/jasmine.js
/Users/alexanderwalter/Development/angularSeed/node_modules/grunt-karma/node_modules/karma/adapter/jasmine.js
/Users/alexanderwalter/Development/angularSeed/app/components/angular/angular.js
/Users/alexanderwalter/Development/angularSeed/app/components/angular-mocks/angular-mocks.js
/Users/alexanderwalter/Development/angularSeed/app/scripts/app.js
/Users/alexanderwalter/Development/angularSeed/app/scripts/controllers/add.js
/Users/alexanderwalter/Development/angularSeed/app/scripts/controllers/main.js
/Users/alexanderwalter/Development/angularSeed/test/spec/controllers/add.js
/Users/alexanderwalter/Development/angularSeed/test/spec/controllers/main.js
DEBUG [web server]: serving: /Users/alexanderwalter/Development/angularSeed/node_modules/grunt-karma/node_modules/karma/static/client.html
DEBUG [web server]: serving: /Users/alexanderwalter/Development/angularSeed/node_modules/grunt-karma/node_modules/karma/static/testacular.js
DEBUG [karma]: New browser has connected on socket wxBffi5IEZn9zQvoTm0J
WARN [launcher]: PhantomJS have not captured in 50000 ms, killing.
DEBUG [launcher]: Process PhantomJS exitted with code 1
ERROR [launcher]: Cannot start PhantomJS
As I said, it works for all other browsers. Phantomjs also works if I pass it a simple test script which prints hello world to the console.
I had the same issue and found out it was a problem with nodejs 0.10.8/0.10.9: https://github.com/karma-runner/karma/issues/558
Downgrading to nodejs 0.10.7 solved the problem for me.
In case you want to go with node 0.10.11, the Proxy option worked for me (Mac 10.6.8, Karma 0.8.5, and node 0.10.11 or 0.10.7. Node 0.10.8/9/10 didn't work.).
Inside the karma.conf.js file:
proxies = {
'/': 'http://localhost:9000'
};
urlRoot = '/__unit/';
Inside the karma-e2e.conf.js file:
proxies = {
'/': 'http://localhost:9000'
};
urlRoot = '/__e2e/';
I upgraded to the latest stable version of Node.js. This solved it for me. currently v.10.20.

Ruby crashes on windows

I'm facing same problem described here: why-rails-fails-with-ruby-exe-has-encountered-a-problem-and-needs-to-close. that is ruby get crashed with following error:
ruby.exe has encountered a problem and needs to close. We are sorry for the inconvenience.
I'm asking this to add some details on it as that question was not asked by me I am not able to add information in it. So this is not duplicate.
Ruby crashes eventually no matter how I run it (in development or in production), but it seems to crash more often in production mode. Sometimes it will crash when I hold down the F5 key, but sometimes I have to hold and release it intermittently for a minute or two. It appears to be very dependent on timing, but I can usually make it crash in less than 60 seconds.
When I refresh the GET request is sent for 3 times as follows:
Started GET "/app/page" for 127.0.0.1 at 2011-02-23 10:57:35 +0530
Processing by AppController#page as HTML
Rendered pms/dashboard.html.erb within layouts/application (109.4ms)
Completed 200 OK in 141ms (Views: 140.6ms | ActiveRecord: 0.0ms)
Started GET "/app/page" for 127.0.0.1 at 2011-02-23 10:57:35 +0530
Processing by AppController#page as */*
Rendered pms/dashboard.html.erb within layouts/application (15.6ms)
Completed 200 OK in 187ms (Views: 187.5ms | ActiveRecord: 0.0ms)
Started GET "/app/page" for 127.0.0.1 at 2011-02-23 10:57:35 +0530
Processing by AppController#page as */*
Rendered pms/dashboard.html.erb within layouts/application (15.6ms)
Completed 200 OK in 219ms (Views: 218.7ms | ActiveRecord: 0.0ms)
And if I rapidly refresh the page get following error in one of or all the 3 request:
ERROR Errno:ECONNABORTED: An established connection was aborted by the software in your host machine:
c:/Ruby/lib/1.9.1/webrick/httpresponse.rb:323:in 'write'
c:/Ruby/lib/1.9.1/webrick/httprespose.rb:323:in '<<'
c:/Ruby/lib/1.9.1/webrick/httprespose.rb:323:in '_write_data'
c:/Ruby/lib/1.9.1/webrick/httprespose.rb:295:in 'send_body_string'
c:/Ruby/lib/1.9.1/webrick/httprespose.rb:186:in 'send_body'
c:/Ruby/lib/1.9.1/webrick/httprespose.rb:103:in 'send_response'
c:/Ruby/lib/1.9.1/webrick/httpserver.rb:86:in 'run'
ERROR Errno:ECONNABORTED: An established connection was aborted by the software in your host machine:
c:/Ruby/lib/1.9.1/webrick/httpserver.rb:56:in 'eof?'
c:/Ruby/lib/1.9.1/webrick/httpserver.rb:56:in 'run'
c:/Ruby/lib/1.9.1/webrick/server.rb:183:in 'block in start_thread'
INFO going to shutdown....
INFO WEBrick::HTTPServer#start done
When I started to get this error?
When I added images, css and javascript in my project I started to get this error. I also tried by removing one of this 3 and see who causes the error but every time my ruby.exe get crashed and i see the error:
ruby.exe has encountered a problem and needs to close. We are sorry for the inconvenience.
How can I solve this?
When I start server following is printed on console:
=>Booting WEBrick
=>Rails 3.0.3 application starting in development on http://0.0.0.0:3000
=>Call with -d to detach
=>Ctrl-C to shutdown server
[2011-02-23 10:59:22] INFO WEBrick 1.3.1
[2011-02-23 10:59:22] INFO ruby 1.9.2 (2010-08-18) [i386-mingw32]
[2011-02-23 10:59:22] INFO WEbrick::HTTPServer#start: pid:2448 port=3000
Output of ruby -v
ruby 1.9.2p0 (2010-08-18) [i386-mingw32]
... except the installer is now ALSO the crashing 1.9.2-p290
Workaround:
Add (or change)
config.log_level = :warn
in config/environments/development.rb
(not my solution - found it in another thread)
Running 1.9.2 on windows puts you in a REALLY small minority of users. If you don't have an explicit need for 1.9, I'd use 1.8.7. Specifically, I'd use the package from RailsInstaller: http://railsinstaller.org/
i got the same crashes on windows 7 with 1.9.2-p290. someone said to clear development.log file. i can't believe but after deleting my 12mb development.log everything works fine.
it is possible that a native (C) extension is failing and bringing the whole ruby down; in my case it was sql server adapter looping indefinitely/using whole heap; after we traced and fixed the bug in the adapter (https://github.com/rails-sqlserver/tiny_tds/pull/124) it does not fail again

Can't open Firefox with profile (not temporary) with Selenium

I want start firefox with my custom profile, and when I add some plugins (for example) in this session starting from selenium I want he do not forgot them.
I started selenium server
start "JAVA Selenium Server" java -jar selenium-server.jar -interactive -firefoxProfileTemplate "D:\Ogame\SeleniumStaticProfile"
Then in selenium server
cmd=getNewBrowserSession&1=*custom firefox.exe -p SeleniumStatic -no-remote&2=http://www.google.com
cmd=open&1=httttp://www.hotmail.com
cmd=open&1=httttp://www.google.pl
and i'm gettings error something like:
www.goole.com havent rights to read properties Window.seleniumMarker1299...
All log:
cmd=getNewBrowserSession&1=*custom firefox.exe -p SeleniumStatic
-no-remote&2=ht tttp://www.google.com 13:54:50.817 INFO - ---> Requesting
htttttp://localhost:4444/selenium-server/driver
?cmd=getNewBrowserSession&1=*custom
firefox.exe -p SeleniumStatic
-no-remote&2=h tttttp://www.google.com 13:54:50.823 INFO - Command request:
getNewBrowserSession[*custom
firefox.exe -p SeleniumStatic
-no-remote, htttttp://www.google.com] on session null 13:54:50.824 INFO -
creating new remote session
13:54:50.832 INFO - Allocated session
ad3e48137d024959863ab8bb4c297d55 for
httttp: //www.google.com, launching...
13:54:54.615 INFO - Got result:
OK,ad3e48137d024959863ab8bb4c297d55 on
session a
d3e48137d024959863ab8bb4c297d55
cmd=open&1=http://www.wp.pl
13:55:23.588 INFO - ---> Requesting
httttp://localhost:4444/selenium-server/driver
?cmd=open&1=htttttp://www.wp.pl&sessionId=ad3e48137d024959863ab8bb4c297d55
13:55:23.595 INFO - Command request:
open[htttttp://www.wp.pl, ] on session
ad3e481 37d024959863ab8bb4c297d55
13:55:23.596 WARN - you appear to be
changing domains from
httttp://www.google.com to
htttttp://www.wp.pl this may lead to a
'Permission denied' from the browser
(unless it is running as *iehta or
*chrome, or alternatively the selenium server is runnttting in proxy
injection mode) 13:55:23.691 INFO -
Got result: Witrynie
http://www.google.com nie udzielono
u prawnien do odczytania wlasciwosci
Window.document z
on sessi on
ad3e48137d024959863ab8bb4c297d55
Of course I have entered proxy in Firefox SeleniumStatic profile (localhost:4444)
What am I doing wrong?
Sorry for my bad english :/
Change your commands to look like the following
cmd=getNewBrowserSession&1=*firefox -no-remote&2=http://www.google.com
cmd=open&1=httttp://www.hotmail.com
cmd=open&1=httttp://www.google.pl
YOu don't need to specify the profile since you have already done that when starting the Selenium Server.

Resources