Yarn: Error An unexpected error occurred: Request failed \"404 Not Found\ - node.js

I´ve got an issue when I run my program with Yarn.
error An unexpected error occurred: "https://npm.pkg.github.com/download/{.../packagename}: Request failed \"404 Not Found\"".
I cloned a GitHub-Repo and installed NodeJS, npm, and Yarn.
I also create a personal access token at GitHub. And configured the registry with:
npm login --registry=https://npm.pkg.github.com
Username: USERNAME
Password: TOKEN
Email: PUBLIC-EMAIL-ADDRESS
info yarn config
{
'version-tag-prefix': 'v',
'version-git-tag': true,
'version-commit-hooks': true,
'version-git-sign': false,
'version-git-message': 'v%s',
'init-version': '1.0.0',
'init-license': 'MIT',
'save-prefix': '^',
'bin-links': true,
'ignore-scripts': false,
'ignore-optional': false,
registry: 'https://registry.yarnpkg.com',
'strict-ssl': false,
'user-agent': 'yarn/1.22.4 npm/? node/v13.8.0 darwin x64',
lastUpdateCheck: 1585820467684
}
info npm config
{
'//npm.pkg.github.com/:_authToken': `{TOKEN}`,
'always-auth': true,
`# { VALUE }:registry`: 'https://npm.pkg.github.com/'
}
Environment
Node Version: 13.8.0
npm Version: 6.13.6
Yarn Version: 1.22.4

Related

Getting MongoServerSelectionError in localhost

I have a node.js application deployed in Azure which connects to Azure CosmosDB (MongoDb database).
To connect to to mongo-db i use this code
const options = {
useUnifiedTopology: true,
useNewUrlParser: true,
}
client = new MongoClient(mongoConnectionUri, options)
// #ts-ignore
global._mongoClientPromise = client.connect()
clientPromise = global._mongoClientPromise
this is working fine when deployed in Azure as containerapp, but when i try to run it from localhost
npm run dev -- -- open
When the part to connect to mongo-db comes, I am getting this error,
MongoServerSelectionError: Server selection timed out after 30000 ms
at Timeout._onTimeout (xyz/node_modules/mongodb/lib/sdam/topology.js:293:38)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7) {
reason: TopologyDescription {
type: 'ReplicaSetNoPrimary',
servers: Map(1) {
'my-db.mongo.cosmos.azure.com:10255' => [ServerDescription]
},
stale: false,
compatible: true,
heartbeatFrequencyMS: 10000,
localThresholdMS: 15,
setName: 'globaldb',
logicalSessionTimeoutMinutes: undefined
},
code: undefined,
[Symbol(errorLabels)]: Set(0) {}
}
MongoDB connection string:
mongodb://my-db:abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz==#my-db.mongo.cosmos.azure.com:10255/?ssl=true&replicaSet=globaldb&retrywrites=false&maxIdleTimeMS=120000&appName=#my-db#
there are no network restrictions
My node version
node --version
v16.17.1
npm version
{
npm: '8.15.0',
node: '16.17.1',
v8: '9.4.146.26-node.22',
uv: '1.43.0',
zlib: '1.2.11',
brotli: '1.0.9',
ares: '1.18.1',
modules: '93',
nghttp2: '1.47.0',
napi: '8',
llhttp: '6.0.9',
openssl: '1.1.1q+quic',
cldr: '41.0',
icu: '71.1',
tz: '2022a',
unicode: '14.0',
ngtcp2: '0.1.0-DEV',
nghttp3: '0.1.0-DEV'
}
This was working from local before , but suddenly it is not working,
From Az cli in my local I am able to retrieve the database details in cosmosdb
az cosmosdb database show --resource-group rgname --name accountname --db-name dbname
Update:
If i try the connection string by installing mongosh
mongosh and the command
mongosh "mongodb://my-db:abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz==#my-db.mongo.cosmos.azure.com:10255/?ssl=true&replicaSet=globaldb&retrywrites=false&maxIdleTimeMS=120000&appName=#my-db#"
MongoServerSelectionError: Server selection timed out after 30000 ms
I am getting the same errorMongoServerSelectionError: Server selection timed out after 30000 ms
Can anyone please help?
Update:
Mobile hotspot:
Able to connect with my mobile-hotspot in the same machine (macOS big slur) to the same remote db without any errors.
Tried this will different versions of node.js and mongodb libraries including latest but the same error when connecting with Home wifi. Before recently i had changed the wifi security from wpa to wpa2 personal and ever since this error occurs

Validation Error in running Hyperledger Caliper V0.4.2 with Fabric 2.1

When I have been running the Caliper V0.4.2 for measuring the benchmarks of Fabric 2.1.0 1.4.7, I got the below error
ValidationError: child "version" fails because ["version" must be one of [1.0]]. child "clients" fails because ["clients" is required]. child "channels" fails because ["channels" must be an object]. child "organizations" fails because ["organizations" must be an object]. child "orderers" fails because ["orderers" is required]. child "peers" fails because ["peers" is required]
at Object.exports.process (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/#hapi/joi/lib/errors.js:202:19)
at internals.Object._validateWithOptions (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/#hapi/joi/lib/types/any/index.js:763:31)
at module.exports.internals.Any.root.validate (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/#hapi/joi/lib/index.js:145:23)
at Function._validateTopLevel (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/#hyperledger/caliper-fabric/lib/configValidator.js:208:26)
at Function.validateNetwork (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/#hyperledger/caliper-fabric/lib/configValidator.js:58:25)
at new FabricConnector (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/#hyperledger/caliper-fabric/lib/fabric-connector.js:107:25)
at CaliperEngine.connectorFactory [as adapterFactory] (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/#hyperledger/caliper-fabric/lib/connectorFactory.js:26:23)
at CaliperEngine.run (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/#hyperledger/caliper-core/lib/manager/caliper-engine.js:93:36)
at Function.handler (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/#hyperledger/caliper-cli/lib/launch/lib/launchManager.js:62:43)
at Object.module.exports.handler (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/#hyperledger/caliper-cli/lib/launch/launchManagerCommand.js:46:44)
isJoi: true,
name: 'ValidationError',
details:
[ { message: '"version" must be one of [1.0]',
path: [Array],
type: 'any.allowOnly',
context: [Object] },
{ message: '"clients" is required',
path: [Array],
type: 'any.required',
context: [Object] },
{ message: '"channels" must be an object',
path: [Array],
type: 'object.base',
context: [Object] },
{ message: '"organizations" must be an object',
path: [Array],
type: 'object.base',
context: [Object] },
{ message: '"orderers" is required',
path: [Array],
type: 'any.required',
context: [Object] },
{ message: '"peers" is required',
path: [Array],
type: 'any.required',
context: [Object] } ],
_object:
{ name: 'Caliper Benchmarks',
version: '2.1.0',
caliper: { blockchain: 'fabric' },
channels: [ [Object] ],
organizations: [ [Object] ] },
annotate: [Function] }
Command that I run are,
npm init -y
npm install --only=prod #hyperledger/caliper-cli#0.4.0
npx caliper bind --caliper-bind-sut fabric:2.1
./network.sh deployCC -ccn simple -ccp ../../caliper-benchmarks/src/fabric/scenario/simple/node -ccl javascript
npx caliper launch manager --caliper-workspace ./ --caliper-networkconfig networks/fabric/test-network.yaml --caliper-benchconfig benchmarks/scenario/simple/config.yaml --caliper-flow-only-test --caliper-fabric-gateway-enabled
Hyperledger network creation, channel creation and Chaincode deployment all were successful.
How to solve this error?
Looks like you are using the main branch of caliper-benchmarks. I would suggest you https://github.com/hyperledger/caliper-benchmarks/blob/main/networks/fabric/README.md
From what you have posted, you should use the latest available version of caliper which is 0.4.2, not 0.4.0. To do so the command you should issue is
npm install --only=prod #hyperledger/caliper-cli
You should bind to the latest 2.2 sdk (don't bind to 2.1 as fabric doesn't support 2.1). Note this is selecting the version of the sdk used to interact with a fabric network, not the version of the fabric network you are using. 2.2 will work with a fabric 2.2 and later 2.x versions
npx caliper bind --caliper-bind-sut fabric:2.2
Finally it looks like you tried to change the version number in the network configuration file. Don't change the version (it must be 2.0.0) as it refers to the version of the network configuration file and not the version of fabric you want to test
As you look to be using test-network, depending on which branch of fabric-samples you are using defines the version of fabric. The main branch tests the latest version of fabric which should have no problems.

how do I install node, npm, angular cli on MAC?

I've been trying to install the angular cli for several days now with now luck. I've tried installing node manually, and with brew. I've uninstalled node and reinstalled. I've also tried fixing the npm permission with steps found here: https://docs.npmjs.com/getting-started/fixing-npm-permissions
I've checked that all the appropriate directories have correct permissions. I do think it odd that even when uninstalling and reinstalling the npm config prefix is
'/Users/myusername/.npm-packages' instead of '/usr/local'.
Any help on how to get this installed correctly would be appreciated!
I'm running macOS Sierra 10.12.6.
node -v = v8.9.0
npm -v = 5.5.1
When trying to run 'ng version' I get '-bash: ng: command not found'.
npm config get prefix =
/Users/myusername/.npm-packages
npm config get
; cli configs
metrics-registry = "https://registry.npmjs.org/"
scope = ""
user-agent = "npm/5.5.1 node/v8.9.0 darwin x64"
; userconfig /Users/myusername/.npmrc
prefix = "/Users/myusername/.npm-packages"
; builtin config undefined
; node bin location = /usr/local/bin/node
; cwd = /Users/myusername/.npm-packages/etc
; HOME = /Users/myusername
; "npm config ls -l" to show all defaults.
npm info #angular/cli
{ name: '#angular/cli',
description: 'CLI tool for Angular',
'dist-tags': { latest: '1.5.0', next: '1.5.0-rc.8' },
versions:
[ '1.0.0-beta.28.3',
'1.0.0-beta.29',
'1.0.0-beta.30',
'1.0.0-beta.31',
'1.0.0-beta.32',
'1.0.0-beta.32.2',
'1.0.0-beta.32.3',
'1.0.0-beta.33',
'1.0.0-beta.33.1',
'1.0.0-rc.0',
'1.0.0-rc.1',
'1.0.0-rc.2',
'1.0.0-rc.3',
'1.0.0-rc.4',
'1.0.0',
'1.0.1',
'1.0.2',
'1.0.3',
'1.0.4',
'1.0.5',
'1.0.6',
'1.1.0-beta.0',
'1.1.0-beta.1',
'1.1.0-rc.0',
'1.1.0-rc.1',
'1.1.0-rc.2',
'1.1.0',
'1.1.1',
'1.1.2',
'1.1.3',
'1.2.0-beta.0',
'1.2.0-beta.1',
'1.2.0-rc.0',
'1.2.0-rc.1',
'1.2.0',
'1.2.1',
'1.2.2',
'1.2.3',
'1.2.4',
'1.2.5',
'1.2.6',
'1.2.7',
'1.2.8',
'1.3.0-beta.0',
'1.3.0-beta.1',
'1.3.0-rc.0',
'1.3.0-rc.1',
'1.3.0-rc.2',
'1.3.0-rc.3',
'1.3.0-rc.4',
'1.3.0-rc.5',
'1.3.0',
'1.3.1',
'1.3.2',
'1.4.0-beta.0',
'1.4.0-beta.1',
'1.4.0-beta.2',
'1.4.0-rc.0',
'1.4.0-rc.1',
'1.4.0-rc.2',
'1.4.0',
'1.4.1',
'1.4.2',
'1.4.3',
'1.4.4',
'1.4.5',
'1.4.6',
'1.4.7',
'1.4.8',
'1.4.9',
'1.5.0-beta.0',
'1.5.0-beta.1',
'1.5.0-beta.2',
'1.5.0-beta.3',
'1.5.0-beta.4',
'1.5.0-rc.0',
'1.5.0-rc.1',
'1.5.0-rc.2',
'1.5.0-rc.3',
'1.5.0-rc.4',
'1.5.0-rc.5',
'1.5.0-rc.6',
'1.5.0-rc.7',
'1.5.0-rc.8',
'1.5.0' ],
maintainers:
[ 'angular-cli <hansl#google.com>',
'angular <angular-core+npm#google.com>' ],
time:
{ modified: '2017-11-01T19:14:57.082Z',
created: '2017-02-01T22:39:48.654Z',
'1.0.0-beta.28.3': '2017-02-01T22:39:48.654Z',
'1.0.0-beta.29': '2017-02-02T02:31:47.645Z',
'1.0.0-beta.30': '2017-02-03T01:33:52.259Z',
'1.0.0-beta.31': '2017-02-09T23:56:06.277Z',
'1.0.0-beta.32': '2017-02-17T01:51:53.654Z',
'1.0.0-beta.32.2': '2017-02-17T02:00:52.484Z',
'1.0.0-beta.32.3': '2017-02-17T02:08:23.149Z',
'1.0.0-beta.33': '2017-02-25T05:21:36.887Z',
'1.0.0-beta.33.1': '2017-02-25T05:59:19.475Z',
'1.0.0-rc.0': '2017-02-25T07:30:35.378Z',
'1.0.0-rc.1': '2017-03-03T03:12:06.772Z',
'1.0.0-rc.2': '2017-03-13T23:35:46.979Z',
'1.0.0-rc.3': '2017-03-21T00:49:12.653Z',
'1.0.0-rc.4': '2017-03-21T01:33:52.067Z',
'1.0.0': '2017-03-24T03:08:08.615Z',
'1.0.1': '2017-04-25T02:55:49.584Z',
'1.0.2': '2017-05-03T22:57:19.031Z',
'1.1.0-beta.0': '2017-05-03T23:50:36.374Z',
'1.0.3': '2017-05-09T21:00:17.413Z',
'1.1.0-beta.1': '2017-05-09T21:42:35.163Z',
'1.1.0-rc.0': '2017-05-15T22:19:37.926Z',
'1.0.4': '2017-05-18T17:54:04.979Z',
'1.0.5': '2017-05-24T22:17:19.130Z',
'1.1.0-rc.1': '2017-05-24T22:36:47.469Z',
'1.0.6': '2017-05-25T17:57:32.914Z',
'1.1.0-rc.2': '2017-05-25T18:22:24.404Z',
'1.1.0': '2017-05-31T20:22:53.831Z',
'1.2.0-beta.0': '2017-05-31T21:13:50.572Z',
'1.1.1': '2017-06-07T21:01:59.836Z',
'1.2.0-beta.1': '2017-06-07T21:44:09.173Z',
'1.1.2': '2017-06-15T20:39:42.222Z',
'1.2.0-rc.0': '2017-06-15T21:16:57.470Z',
'1.1.3': '2017-06-21T21:48:12.505Z',
'1.2.0-rc.1': '2017-06-21T22:31:33.214Z',
'1.2.0': '2017-06-29T19:21:25.576Z',
'1.3.0-beta.0': '2017-06-29T19:55:56.904Z',
'1.2.1': '2017-07-12T17:34:40.198Z',
'1.3.0-beta.1': '2017-07-12T18:38:33.167Z',
'1.2.2': '2017-07-20T21:06:26.951Z',
'1.2.3': '2017-07-21T17:57:50.477Z',
'1.3.0-rc.0': '2017-07-21T22:22:01.734Z',
'1.2.4': '2017-07-24T19:01:16.743Z',
'1.3.0-rc.1': '2017-07-24T19:03:08.281Z',
'1.2.5': '2017-07-26T21:09:37.299Z',
'1.3.0-rc.2': '2017-07-26T21:26:55.403Z',
'1.2.6': '2017-07-27T18:29:09.611Z',
'1.3.0-rc.3': '2017-07-27T18:55:31.455Z',
'1.2.7': '2017-08-03T17:51:53.604Z',
'1.3.0-rc.4': '2017-08-03T18:26:06.546Z',
'1.3.0-rc.5': '2017-08-03T19:16:35.510Z',
'1.2.8': '2017-08-09T22:34:57.034Z',
'1.3.0': '2017-08-09T23:33:40.392Z',
'1.4.0-beta.0': '2017-08-10T23:31:35.610Z',
'1.3.1': '2017-08-17T20:44:40.289Z',
'1.4.0-beta.1': '2017-08-18T00:00:02.218Z',
'1.4.0-beta.2': '2017-08-18T19:06:12.921Z',
'1.3.2': '2017-08-23T22:03:53.021Z',
'1.4.0-rc.0': '2017-08-23T22:11:28.919Z',
'1.4.0-rc.1': '2017-08-25T21:05:15.145Z',
'1.4.0-rc.2': '2017-08-30T00:23:14.662Z',
'1.4.0': '2017-09-07T16:31:09.637Z',
'1.4.1': '2017-09-08T22:39:19.578Z',
'1.5.0-beta.0': '2017-09-14T00:03:25.612Z',
'1.4.2': '2017-09-14T00:35:39.637Z',
'1.4.3': '2017-09-22T02:00:04.404Z',
'1.5.0-beta.1': '2017-09-22T02:02:52.519Z',
'1.4.4': '2017-09-28T23:01:05.205Z',
'1.5.0-beta.2': '2017-09-28T23:03:16.645Z',
'1.5.0-beta.3': '2017-10-03T20:33:31.803Z',
'1.4.5': '2017-10-05T21:29:06.347Z',
'1.5.0-beta.4': '2017-10-05T21:32:26.527Z',
'1.4.6': '2017-10-12T01:31:14.231Z',
'1.4.7': '2017-10-12T16:52:14.901Z',
'1.5.0-rc.0': '2017-10-12T17:28:05.424Z',
'1.4.8': '2017-10-18T20:09:29.000Z',
'1.5.0-rc.1': '2017-10-18T20:13:37.270Z',
'1.4.9': '2017-10-19T22:54:59.961Z',
'1.5.0-rc.2': '2017-10-19T23:36:26.426Z',
'1.5.0-rc.3': '2017-10-24T05:17:28.861Z',
'1.5.0-rc.4': '2017-10-26T17:21:40.607Z',
'1.5.0-rc.5': '2017-10-27T01:21:13.361Z',
'1.5.0-rc.6': '2017-10-28T00:35:11.786Z',
'1.5.0-rc.7': '2017-10-30T18:27:09.785Z',
'1.5.0-rc.8': '2017-10-30T23:39:34.512Z',
'1.5.0': '2017-11-01T19:14:57.082Z' },
homepage: 'https://github.com/angular/angular-cli',
keywords: [ 'angular', 'angular-cli', 'Angular CLI' ],
repository:
{ type: 'git',
url: 'git+https://github.com/angular/angular-cli.git' },
author: 'Angular Authors',
bugs: { url: 'https://github.com/angular/angular-cli/issues' },
license: 'MIT',
readmeFilename: 'README.md',
users:
{ avil13: true,
tonimoeckel: true,
jota: true,
baschte: true,
stormos: true,
szamocza: true,
db6edr: true,
willvanpelt: true,
'ognjen.jevremovic': true,
plastikaweb: true,
waiwaiku: true,
adli: true,
reekdeb: true,
'n.sanitate': true,
niilante: true,
qingqingcao: true,
stefaans: true,
'jlouros-io': true,
fadihania: true,
wilda: true,
fdagosti: true,
albertico88: true,
kremr: true,
plauret: true,
infrabill: true,
manojkhannakm: true,
julianomontini: true,
'stone-jin': true,
springy: true,
fmakareev: true,
rastrearcelularonline: true,
majkel: true,
onsentamago: true,
markymark: true,
korbraan: true,
allen_l_liu: true,
polyeezy: true,
joshdoescode: true,
sirhcybe: true,
shadster: true,
samersm: true,
tommyldunn: true,
willwm: true,
aran_sk: true,
khcjump: true,
orenschwartz: true,
yangzw: true,
stephanlv: true,
advpat: true,
tifbs: true,
johnnyjohnjohn: true,
iamclaytonray: true,
shekharreddy: true,
elijahsh: true },
version: '1.5.0',
main: 'lib/cli/index.js',
trackingCode: 'UA-8594346-19',
bin: { ng: './bin/ng' },
engines: { node: '>= 6.9.0', npm: '>= 3.0.0' },
dependencies:
{ '#angular-devkit/build-optimizer': '~0.0.31',
'#angular-devkit/schematics': '~0.0.34',
'#ngtools/json-schema': '1.1.0',
'#ngtools/webpack': '1.8.0',
'#schematics/angular': '~0.1.0',
autoprefixer: '^6.5.3',
chalk: '~2.2.0',
'circular-dependency-plugin': '^3.0.0',
'common-tags': '^1.3.1',
'copy-webpack-plugin': '^4.1.1',
'core-object': '^3.1.0',
'css-loader': '^0.28.1',
cssnano: '^3.10.0',
denodeify: '^1.2.1',
'ember-cli-string-utils': '^1.0.0',
'exports-loader': '^0.6.3',
'extract-text-webpack-plugin': '3.0.0',
'file-loader': '^1.1.5',
'fs-extra': '^4.0.0',
glob: '^7.0.3',
'html-webpack-plugin': '^2.29.0',
'karma-source-map-support': '^1.2.0',
less: '^2.7.2',
'less-loader': '^4.0.5',
'license-webpack-plugin': '^1.0.0',
lodash: '^4.11.1',
'memory-fs': '^0.4.1',
'node-modules-path': '^1.0.0',
nopt: '^4.0.1',
opn: '~5.1.0',
portfinder: '~1.0.12',
'postcss-custom-properties': '^6.1.0',
'postcss-loader': '^1.3.3',
'postcss-url': '^5.1.2',
'raw-loader': '^0.5.1',
resolve: '^1.1.7',
rxjs: '^5.5.2',
'sass-loader': '^6.0.3',
semver: '^5.1.0',
'silent-error': '^1.0.0',
'source-map-loader': '^0.2.0',
'source-map-support': '^0.4.1',
'istanbul-instrumenter-loader': '^2.0.0',
'style-loader': '^0.13.1',
stylus: '^0.54.5',
'stylus-loader': '^3.0.1',
'uglifyjs-webpack-plugin': '1.0.0',
'url-loader': '^0.6.2',
webpack: '~3.8.1',
'webpack-concat-plugin': '1.4.0',
'webpack-dev-middleware': '~1.12.0',
'webpack-dev-server': '~2.9.3',
'webpack-merge': '^4.1.0',
'webpack-sources': '^1.0.0',
'webpack-subresource-integrity': '^1.0.1',
'zone.js': '^0.8.14',
'node-sass': '^4.3.0' },
optionalDependencies: { 'node-sass': '^4.3.0' },
dist:
{ integrity: 'sha512-nCXvqNCdi+8aOU2v6EABZsMg5bB7iM+wfaoWKnu9M5fOW2Rm+7/3Y1gDQKyFkgXCzXdy3J/xpfmwT0gjmjlvIA==',
shasum: '2abc3ff1648d54ad4a14f82f9d517f371370406c',
tarball: 'https://registry.npmjs.org/#angular/cli/-/cli-1.5.0.tgz' },
directories: {} }
I'll be talking about Angular CLI only.
With reference to Angular CLI, I'll assume that you tried installing it without -g flag with NPM.
Step 1: Install Angular CLI from NPM
npm install -g #angular/cli
Step 2: Generate a new app from Angular CLI
ng new <APP NAME>
Step 3: Changing directories
cd <APP NAME>
Step 4: Serving your app
ng serve
If all fails, please have a try of the following.
Step 1: Changing directories (Fallback Option)
cd <NPM ANGULAR CLI DIRECTORY>
Step 2: Running ng locally (Fallback Option)
./bin/ng new <APP NAME> --directory <WHERE EVER YOU WANT IT TO GENERATE>
Hope this helps.

Why does web-component-tester time out in flight mode?

I've got a basic web-component-tester project which works fine when I'm online.
If I switch to flight mode, it seems to fail to connect to Selenium, and instead gives a largely useless error message after about 60s delay: "Error: Unable to connect to selenium".
Edit 2: I've narrowed the problem down in the following question, but I'd still like to know how to avoid it with web-component-tester:
Why does NodeJS request() fail on localhost in flight mode, but not 127.0.0.1? (Windows 10)
Edit: After some digging, it's something to do with DNS resolver somewhere beneath selenium-standalone failing while in flight mode, and not a lot to do with web-component-tester.
After inserting some debug logging into selenium-standalone, I tracked down the failure point to the check for whether Selenium is running. When online, this works fine, but when offline I get:
// check-started.js, logging the error inside the request() call:
Error: getaddrinfo ENOENT localhost:60435
at Object.exports._errnoException (util.js:1022:11)
at errnoException (dns.js:33:15)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)
The following seem to describe similar situations, but I don't see how to persuade selenium-standalone nor web-component-tester to specify an IP address family to even try the suggested solutions:
https://github.com/nodejs/node/issues/4825
https://github.com/nodejs/node/issues/10290
node.js http.request and ipv6 vs ipv4
My original text is below.
The full error log and wct.conf.json are below. I can supply package.json and bower.json too if it would help.
I'm on Windows 10.
wct.conf.json:
{
"verbose": true,
"plugins": {
"local": {
"skipSeleniumInstall": true,
"browsers": ["chrome"]
},
"sauce": {
"disabled": true
}
}
}
error log:
> color-curve#0.0.1 test C:\Users\Dave\projects\infinity-components\color-curve
> standard "**/*.html" && wct -l chrome
step: loadPlugins
step: configure
hook: configure
Expanded local browsers: [ 'chrome' ] into capabilities: [ { browserName: 'chrome',
version: '60',
chromeOptions:
{ binary: 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe',
args: [Object] } } ]
configuration: { suites: [ 'test/index.html' ],
verbose: true,
quiet: false,
expanded: false,
testTimeout: 90000,
persistent: false,
extraScripts: [],
clientOptions: { root: '/components/', verbose: true },
compile: 'auto',
activeBrowsers: [ { browserName: 'chrome', version: '60', chromeOptions: [Object] } ],
browserOptions: {},
plugins:
{ local:
{ disabled: false,
skipSeleniumInstall: true,
browsers: [Object],
seleniumArgs: [] },
sauce: { disabled: true } },
registerHooks: [Function: registerHooks],
enforceJsonConf: false,
webserver:
{ hostname: 'localhost',
_generatedIndexContent: '<!doctype html>\n<html>\n <head>\n <meta charset="utf-8">\n <script>WCT = {"root":"/components/","verbose":true};</script>\n <script>window.__generatedByWct = true;</script>\n <script src="../web-component-tester/browser.js"></script>\n\n <script src="../web-component-tester/data/a11ySuite.js"></script>\n</head>\n <body>\n <script>\n WCT.loadSuites(["test/index.html"]);\n </script>\n </body>\n</html>\n' },
root: 'C:\\Users\\Dave\\projects\\infinity-components\\color-curve',
_: [],
origSuites: [ 'test/' ] }
hook: prepare
hook: prepare:selenium
Starting Selenium server for local browsers
INFO - Selenium build info: version: '3.0.1', revision: '1969d75'
INFO - Launching a standalone Selenium Server
INFO::main: Logging initialized #222ms
INFO - Driver class not found: com.opera.core.systems.OperaDriver
INFO - Driver provider com.opera.core.systems.OperaDriver registration is skipped:
Unable to create new instances on this machine.
INFO - Driver class not found: com.opera.core.systems.OperaDriver
INFO - Driver provider com.opera.core.systems.OperaDriver is not registered
INFO - Driver provider org.openqa.selenium.safari.SafariDriver registration is skipped:
registration capabilities Capabilities [{browserName=safari, version=, platform=MAC}] does not match the current platform WIN10
INFO:osjs.Server:main: jetty-9.2.15.v20160210
INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletContextHandler#100fc185{/,null,AVAILABLE}
INFO:osjs.ServerConnector:main: Started ServerConnector#2922e2bb{HTTP/1.1}{0.0.0.0:51126}
INFO:osjs.Server:main: Started #419ms
INFO - Selenium Server is up and running
INFO - Selenium build info: version: '3.0.1', revision: '1969d75'
INFO - Launching a standalone Selenium Server
INFO::main: Logging initialized #222ms
INFO - Driver class not found: com.opera.core.systems.OperaDriver
INFO - Driver provider com.opera.core.systems.OperaDriver registration is skipped:
Unable to create new instances on this machine.
INFO - Driver class not found: com.opera.core.systems.OperaDriver
INFO - Driver provider com.opera.core.systems.OperaDriver is not registered
INFO - Driver provider org.openqa.selenium.safari.SafariDriver registration is skipped:
registration capabilities Capabilities [{browserName=safari, version=, platform=MAC}] does not match the current platform WIN10
INFO:osjs.Server:main: jetty-9.2.15.v20160210
INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletContextHandler#100fc185{/,null,AVAILABLE}
INFO:osjs.ServerConnector:main: Started ServerConnector#2922e2bb{HTTP/1.1}{0.0.0.0:51126}
INFO:osjs.Server:main: Started #419ms
INFO - Selenium Server is up and running
Error: Unable to connect to selenium

Error code 135, Error message Could not fingd update-config.json. Run webdriver-manager update to download the binaries

I am trying to execute my tests in nodejs using protractor.
Example protractor protractor.conf
When I run protractor protractor.conf, I get error Error code 135, Error message Could not fingd update-config.json. Run webdriver-manager update to download the binaries
I ran the following command but still get the above error message
webdriver-manager update -- proxy http://
protractor.conf.js
/*global jasmine */
var SpecReporter = require('jasmine-spec-reporter');
var TfsReporter = require('jasmine-tfs-reporter');
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./src/tests/*spec.js'
],
capabilities: {
'browserName': 'chrome',
/*'browserName': 'phantomjs',
'phantomjs.binary.path': require('phantomjs-prebuilt').path,
'phantomjs.ghostdriver.cli.args': ['--loglevel=DEBUG']*/
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
useAllAngular2AppRoots: false,
beforeLaunch: function() {
require('ts-node').register({
project: '../PartyAndIndustryDataMigration'
});
},
onPrepare: function() {
jasmine.getEnv().addReporter(new SpecReporter());
jasmine.getEnv().addReporter(new TfsReporter());
}
};
I'm not 100% sure (and cannot it check now), but shouldn't command look like that:
webdriver-manager update --proxy http:// (without space between -- and proxy)?
I guess chrome driver & update-config.json couldn't downloaded at the time of webdriver-manager update.
Just for verification go to
node_modules\protractor\node_modules\webdriver-manager\selenium\
location and look if everything downloaded properly?
If there is problem on downloading chrome driver you can check chrome-response.xml in same location for reason. One reason could be chrome driver website is in blacklisted or behind the proxy.
1.Open Command prompt or terminal.
2.Go to your project root directory.
3.Enter the below command and hit Enter key.
node node_modules/protractor/bin/webdriver-manager update
This command will update the WebDriver Manager.

Resources