lucono/karma-test-explorer

Karma server is started with the wrong Node installation

Closed this issue · 4 comments

Describe the Bug

Karma server fails after updating to v0.3.0

Steps to Reproduce the Behavior

I'm using Remote SSH extension to connect to the development machine running Windows 10. After starting, VSCode shows error notification:

image

Describe the Expected Behavior

Extension works as before

Provide Debug Logs

  • Karma Test Explorer:
[2021-11-08 14:11:55.118] [INFO] [KarmaTestEventListener]: New socket connection from Karma on port 9999
[2021-11-08 14:11:55.118] [DEBUG] [KarmaTestEventListener]: Listening for Karma events
[2021-11-08 14:11:55.125] [DEBUG] [KarmaTestEventListener]: Received Karma event: file_list_modified
[2021-11-08 14:11:55.125] [DEBUG] [KarmaTestEventListener]: Ignoring received karma event: file_list_modified
[2021-11-08 14:11:55.223] [DEBUG] [KarmaTestEventListener]: Received Karma event: listening
[2021-11-08 14:11:55.223] [DEBUG] [KarmaTestEventListener]: Karma server on karma port 9976 is ready for requests
[2021-11-08 14:12:13.053] [DEBUG] [KarmaTestEventListener]: Received Karma event: compile_error
[2021-11-08 14:12:13.053] [DEBUG] [KarmaTestEventListener]: Received unregistered error event: compile_error
[2021-11-08 14:12:13.053] [DEBUG] [KarmaTestEventListener]: Test error processing requested with message: Error event: compile_error
[2021-11-08 14:12:13.054] [DEBUG] [KarmaTestEventListener]: Received Karma event: run_complete
[2021-11-08 14:12:13.054] [DEBUG] [KarmaTestEventListener]: Test run completed with status 'Complete' for browsers: 
[2021-11-08 14:12:13.054] [DEBUG] [KarmaTestEventListener]: Received 'run_complete' event with run Id 'undefined' while no requested user test capture
[2021-11-08 14:12:19.442] [DEBUG] [KarmaTestEventListener]: Received Karma event: browsers_change
[2021-11-08 14:12:19.442] [DEBUG] [KarmaTestEventListener]: Ignoring received karma event: browsers_change
[2021-11-08 14:12:19.442] [DEBUG] [KarmaTestEventListener]: Received Karma event: browser_register
[2021-11-08 14:12:19.442] [DEBUG] [KarmaTestEventListener]: Ignoring received karma event: browser_register
[2021-11-08 14:12:19.442] [DEBUG] [KarmaTestEventListener]: Received Karma event: browsers_ready
[2021-11-08 14:12:19.442] [DEBUG] [KarmaTestEventListener]: Browsers connected and ready for test execution
[2021-11-08 14:12:19.443] [INFO] [DefaultTestManager]: Discovering tests
[2021-11-08 14:12:19.444] [DEBUG] [KarmaTestEventListener]: Started listening for test run Id: jnv7066awr
[2021-11-08 14:12:19.444] [DEBUG] [KarmaTestRunner]: Executing test discovery run id: jnv7066awr
[2021-11-08 14:12:19.447] [DEBUG] [KarmaHttpTestRunExecutor]: Sending karma run http request
[2021-11-08 14:12:19.450] [DEBUG] [KarmaTestEventListener]: Received Karma event: run_start
[2021-11-08 14:12:19.450] [DEBUG] [KarmaTestEventListener]: Test run started for browsers: Chrome Headless 95.0.4638.69 (Windows 10)
[2021-11-08 14:12:19.451] [DEBUG] [KarmaTestEventListener]: New test run starting with id 'undefined' is not for the current requested test run Id: jnv7066awr
[2021-11-08 14:12:19.451] [DEBUG] [KarmaAutoWatchTestEventProcessor]: Beginning ambient test event processing
[2021-11-08 14:12:19.451] [DEBUG] [KarmaAutoWatchTestEventProcessor:KarmaTestEventProcessor]: Request to begin test event processing
[2021-11-08 14:12:19.451] [DEBUG] [KarmaAutoWatchTestEventProcessor:KarmaTestEventProcessor]: Proceeding to begin processing test events
[2021-11-08 14:12:19.453] [DEBUG] [KarmaHttpTestRunExecutor]: Finished sending http test run request
[2021-11-08 14:12:19.470] [DEBUG] [KarmaTestEventListener]: Received Karma event: file_list_modified
[2021-11-08 14:12:19.470] [DEBUG] [KarmaTestEventListener]: Ignoring received karma event: file_list_modified
[2021-11-08 14:12:19.470] [DEBUG] [KarmaTestEventListener]: Received Karma event: run_start
[2021-11-08 14:12:19.470] [DEBUG] [KarmaTestEventListener]: Test run started for browsers: Chrome Headless 95.0.4638.69 (Windows 10)
[2021-11-08 14:12:19.471] [DEBUG] [KarmaAutoWatchTestEventProcessor]: Aborting current ambient event processing - New test is starting
[2021-11-08 14:12:19.471] [DEBUG] [KarmaAutoWatchTestEventProcessor:KarmaTestEventProcessor]: Request to process test error event with message: New test is starting
[2021-11-08 14:12:19.471] [DEBUG] [KarmaAutoWatchTestEventProcessor:KarmaTestEventProcessor]: Request to conclude test event processing
[2021-11-08 14:12:19.471] [DEBUG] [KarmaTestEventListener]: Test run starting for requested test run Id: jnv7066awr
[2021-11-08 14:12:19.471] [DEBUG] [KarmaTestEventListener]: Starting test capture session for current requested test run Id: jnv7066awr
[2021-11-08 14:12:19.471] [DEBUG] [KarmaTestEventProcessor]: Request to begin test event processing
[2021-11-08 14:12:19.471] [DEBUG] [KarmaTestEventProcessor]: Proceeding to begin processing test events
[2021-11-08 14:12:19.471] [WARN] [KarmaAutoWatchTestEventProcessor]: Aborting current ambient event processing - New test is starting
[2021-11-08 14:12:19.471] [DEBUG] [KarmaAutoWatchTestEventProcessor]: Concluding ambient test event processing
[2021-11-08 14:12:19.471] [DEBUG] [KarmaAutoWatchTestEventProcessor]: Retiring 0 skipped ambient test ids
[2021-11-08 14:12:19.472] [DEBUG] [KarmaAutoWatchTestEventProcessor]: Done concluding ambient test event processing
[2021-11-08 14:12:19.472] [DEBUG] [KarmaTestEventListener]: Received Karma event: run_start
[2021-11-08 14:12:19.472] [DEBUG] [KarmaTestEventListener]: Test run started for browsers: Chrome Headless 95.0.4638.69 (Windows 10)
[2021-11-08 14:12:19.472] [DEBUG] [KarmaTestEventListener]: Test run starting for requested test run Id: jnv7066awr
[2021-11-08 14:12:19.472] [WARN] [KarmaTestEventListener]: New requested test run with run id 'jnv7066awr' is starting while another one with same Id is already in progress - Continuing with existing test
[2021-11-08 14:12:19.504] [DEBUG] [KarmaTestEventListener]: Received Karma event: browser_start
[2021-11-08 14:12:19.504] [DEBUG] [KarmaTestEventListener]: Test run started in browser: Chrome Headless 95.0.4638.69 (Windows 10)
[2021-11-08 14:12:19.506] [DEBUG] [KarmaTestEventListener]: Received Karma event: browsers_change
[2021-11-08 14:12:19.506] [DEBUG] [KarmaTestEventListener]: Ignoring received karma event: browsers_change
[2021-11-08 14:12:19.506] [DEBUG] [KarmaTestEventListener]: Received Karma event: browser_complete
[2021-11-08 14:12:19.506] [DEBUG] [KarmaTestEventListener]: Test run completed in browser: Chrome Headless 95.0.4638.69 (Windows 10)
[2021-11-08 14:12:19.506] [DEBUG] [KarmaTestEventListener]: Received Karma event: browser_complete_with_no_more_retries
[2021-11-08 14:12:19.506] [DEBUG] [KarmaTestEventListener]: Ignoring received karma event: browser_complete_with_no_more_retries
[2021-11-08 14:12:19.508] [DEBUG] [KarmaTestEventListener]: Received Karma event: run_complete
[2021-11-08 14:12:19.508] [DEBUG] [KarmaTestEventListener]: Test run completed with status 'Complete' for browsers: Chrome Headless 95.0.4638.69 (Windows 10)
[2021-11-08 14:12:19.508] [DEBUG] [KarmaTestEventListener]: Test run ending for current requested test run Id: jnv7066awr
[2021-11-08 14:12:19.508] [DEBUG] [KarmaTestEventListener]: Ending test capture session for current requested test run Id: jnv7066awr
[2021-11-08 14:12:19.508] [DEBUG] [KarmaTestEventProcessor]: Request to conclude test event processing
[2021-11-08 14:12:19.508] [DEBUG] [KarmaTestEventProcessor]: Test event processor is currently processing - Concluding current processing
[2021-11-08 14:12:19.510] [DEBUG] [KarmaTestEventListener]: Done listening for test run Id: jnv7066awr
[2021-11-08 14:12:19.510] [DEBUG] [KarmaTestRunner]: Processing specs from test discovery
[2021-11-08 14:12:19.510] [DEBUG] [SpecResponseToTestSuiteInfoMapper]: Mapped 0 tests from specs
[2021-11-08 14:12:19.511] [DEBUG] [TestSuiteOrganizer]: Rearranged 0 test files into folders
[2021-11-08 14:12:19.511] [DEBUG] [TestDiscoveryProcessor]: Test discovery - No tests found
[2021-11-08 14:12:19.511] [INFO] [DefaultTestManager]: Discovered 0 total tests
[2021-11-08 14:12:19.511] [DEBUG] [Adapter]: Test discovery got 0 tests
[2021-11-08 14:12:19.511] [DEBUG] [Adapter]: Updating loaded test tree
[2021-11-08 14:12:19.513] [DEBUG] [Adapter]: Cannot run new test - Another test operation is still running
[2021-11-08 14:12:19.513] [DEBUG] [Notifications]: Showing 'Warning' notification with actions [] and message: Cannot run new test - Another test operation is still running
[2021-11-08 14:12:19.514] [INFO] [Adapter]: Finished loading tests in 51.56 secs (0 tests loaded)
[2021-11-08 14:12:19.514] [DEBUG] [KarmaHttpTestRunExecutor]: Karma http request closed
  • Karma Server:
08 11 2021 07:52:10.532:WARN [karma-server]: Passing raw CLI options to `new Server(config, done)` is deprecated. Use `parseConfig(configFilePath, cliOptions, {promiseConfig: true, throwErrors: true})` to prepare a processed `Config` instance and pass that as the `config` argument instead.

[stderr]: (node:17864) Warning: Accessing non-existent property 'VERSION' of module exports inside circular dependency
(Use `node.EXE --trace-warnings ...` to show where the warning was created)

08 11 2021 07:52:32.953:WARN [karma]: No captured browser, open http://localhost:9976/

08 11 2021 07:52:32.973:INFO [karma-server]: Karma v6.3.5 server started at http://localhost:9976/

08 11 2021 07:52:32.974:INFO [launcher]: Launching browsers KarmaTestExplorer_CustomLauncher with concurrency unlimited

08 11 2021 07:52:32.979:INFO [launcher]: Starting browser Chrome

[stderr]: Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating

[stderr]: 
ERROR in ./projects/REDACTED/src/styles/styles.scss (./node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./node_modules/sass-loader/lib/loader.js??ref--14-3!./projects/REDACTED/src/styles/styles.scss)
Module build failed (from ./node_modules/sass-loader/lib/loader.js):
Error: Missing binding C:\REDACTED\node_modules\node-sass\vendor\win32-x64-83\binding.node
Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 14.x

Found bindings for the following environments:
  - Windows 64-bit with Node.js 10.x

This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass` to download the binding for your current environment.

Please Provide the Following Information

  • OS: Windows 10 (Both machines)
  • Environment: SSH session

Additional Context

Project uses node 10.20, I'm not sure how karma server gets node 14.x (might it be problem with PATH variable? 🤔)

@Federerer There's an earlier part of the log where it prints the command used to start Karma (search for executing command in the output channel to find it). Could you:

  • Attach that as well
  • Run the command which node from your project folder on the remote SSH host and attach the output as well?

Looks like karma is using node binary from vscode-server:
Executing command: 'C:\Users\USERNAME\.vscode-server\bin\b3318bc0524af3d74034b8bb8a64df0ccf35549a\node.EXE'
Running Get-Command node through vscode terminal gives:

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     node.exe                                           10.20.0.0  C:\Program Files\nodejs\node.exe

@Federerer The beta branch switches to using the same node installation as npx. Test that out to confirm if it behaves correctly for your case. You can download the .vsix artifact from the CI build, or build it from the beta branch.

@Federerer this was released with v0.4.0. Please reopen if you still experience the problem.

FYI @michalusio.