Command failed unable to get local issuer certificate - electron

When I create a brand new create-react-app and run the command yarn add electron --dev I get the following error.
RequestError: unable to get local issuer certificate
at ClientRequest.<anonymous> (C:\my-stuff\create-react-test\node_modules\got\source\request-as-event-emitter.js:178:14)
at Object.onceWrapper (events.js:520:26)
at ClientRequest.emit (events.js:412:35)
at ClientRequest.origin.emit (C:\my-stuff\create-react-test\node_modules\#szmarczak\http-timer\source\index.js:37:11)
at TLSSocket.socketErrorListener (_http_client.js:475:9)
at TLSSocket.emit (events.js:400:28)
The same thing happens with npm and chocolatey and only with electron. This doesn't happen on other computers. I've completely uninstalled node and reinstalled it.
This happens after it finished downloading the module. It is making a ClientRequest to a location on my computer. I don't understand why.
I've searched the internet for days for a solution. I've found the cnpm solution and it does work, but I want my project to be restorable from the git repository using npm install or yarn. Right now it is not. I'd have to remove electron from my package.json, restore, add it back and call the cnpm command.
npm config set strict-ssl false <- This command does not help.
I've tried separately installing got and #szmarczak\http-timer. This did not help.

I know it's old question but if anyone is facing this issue try running yarn config set enableStrictSsl false

Related

NPM browserstack alias installed by package.json for TestCafe not recognized

Installing 'testcafe-browser-provider-browserstack' by package.json causes Jenkins job not to recognize 'browserstack'
Tried removing from package.json and install from command line but dependencies cause npm install to error.
testcafe 1.1.4
testcafe-browser-provider-browserstack 1.8.0
npm install
node_modules/.bin/testcafe -e browserstack:safari auth-subscriber-access-myaccount.js
ERROR Unable to find the browser. "browserstack:safari" is not a browser alias or path to an executable file.
One way to debug the issue would be to run the test explicitly with your BrowserStack credentials with the following command -
BROWSERSTACK_USERNAME="YOUR_USERNAME" BROWSERSTACK_ACCESS_KEY="YOUR_KEY" testcafe "browserstack:safari#12.0:OS X Mojave" "path/to/test/file.js"
I tried different paths and also moving to devDependencies in package.json but wasn't successful. I removed from package.json and installed command line at run time and it works.
Maybe I didn't find the right path to call it or it needs to be "local" installed but it now recognizes 'browserstack' this way.

Error: failed to request identity. Error trying to enroll user and return certificates

I am biginner in block chain development. I succesfully run ./startFabric.sh and ./createPeerAdminCard.sh .Then i succesfully run two command as follow below.
composer runtime install -c PeerAdmin#byfn-network-org1-only -n trade-network
composer runtime install -c PeerAdmin#byfn-network-org2-only -n trade-network
Then i tried to run
composer identity request -c PeerAdmin#byfn-network-org1-only -u admin -s adminpw -d alice
But i got error like the following
Error: failed to request identity. Error trying to enroll user and return certificates. Error: Calling enrollment endpoint failed with error [Error: connect ECONNREFUSED 127.0.0.1:7054]
I tried many time to kill all process in docker and remove .composer file from home directory. But always showing the same error message.
Please help me as possible
Os: Ubuntu 16.04
Fabric vertion:1.0.4
Composer vertion:0.16.6
Thanks..
This error "Failed to import the business network card Connection profile has no x-type property defined." means that a v0.20 client can't/won't import a card from an earlier version (probably v0.16).
I think maybe you are running the wrong version of createPeerAdminCard.sh script and it is trying to create and import an 'old' card.
With Composer v0.20 you need to get 'new' copies of the fabric-development-servers scripts which work with Fabric 1.2.
So I would suggest running the following:
run teardownAllDocker.sh script
remove the fabric-dev-server folder (might be fabric-tools if old)
remove the ~/.composer folder
follow the install doc from Step 4 . - make sure to export FABRIC_VERSION=hlfv12 - this is what makes sure you get Fabric 1.2.
This is difficult to help ...
The first 2 scripts you have run (./startFabric.sh and ./createPeerAdminCard.sh) are for a basic development Fabric.
The next 2 commands look like they are from the Multi-Org tutorial which uses a different Fabric and has different cards and crypto material.
Unless there is a particular reason for using an old version of Composer, I would suggest using Composer v0.20, which requires Fabric 1.2.
If you are a beginner I would suggest working with the Developer Tutorial to start with.
if you are using a default file (e.g. connection.json, env.json, etc.) to hold your base connnection profile, simply change the "type" term in that default file to "x-type"
In converting from v0.16 to v0.20, you must first remove the v0.16 composer tools from your system, then install the v0.20 version.
To remove v0.16.6:
npm uninstall -g composer-cli
npm uninstall -g generator-hyperledger-composer
npm uninstall -g composer-rest-server
To install V0.20.2:
npm install -g --python=python2.7 composer-cli#0.20.2
npm install -g --python=python2.7 generator-hyperledger-composer#0.20.2
npm install -g --python=python2.7 composer-rest-server#0.20.2
npm install -g --python=python2.7 yo
If you're running nodejs, then you also have to update both package.json files (network/package/json as well as your {base folder}package.json) from 0.16.x to ^0.20.2
The reason for error is Missing of Certificate Authorities(CA). I Just up my CA server. Now Working perfectly.

Yarn ignores proxy settings

I try to get a build job running using yarn and react-native on a windows 10 machine. The following commands are executed inside of jenkins to prepare the actual build of a native Windows app.
yarn config set proxy http://192.109.190.88:8080
yarn config set https-proxy http://192.109.190.88:8080
yarn add react-native
This leads to the following output although the proxy settings are correct (tried "http://192.109.190.88:8080/" as well):
yarn add v0.27.5
[1/4] Resolving packages...
warning There appears to be trouble with your network connection. Retrying...
warning There appears to be trouble with your network connection. Retrying...
warning There appears to be trouble with your network connection. Retrying...
warning There appears to be trouble with your network connection. Retrying...
Any ideas on why this happens are well appreciated.
yarn version 2 requires a different variable name:
yarn config set httpProxy http://...
yarn config set httpsProxy http://...
Just follow this Link
https://yarnpkg.com/lang/en/docs/cli/config/
and remove the https-proxy and it worked for me.
I had the same issue and solved by following steps:
Run the following terminal command
npm cache clean --force
set http_proxy=
set https_proxy=
yarn config delete proxy
npm config rm https-proxy
npm config rm proxy
Restart your terminal
yarn
yarn –network-timeout 100000
Restart your terminal
it worked for me.

Not able to run angular material docs on locally

Environment: Windows 7, npm 2.11.3, bower 1.4.1, gulp CLI 3.9.0
I Cloned angular material (https://github.com/angular/material/tree/v0.10.1) using WebStorm. I followed the (https://github.com/angular/material/tree/v0.10.1/docs) to install angular-material locally.
At root directory /
I run npm install it runs (with some warnings) and downloaded its dependencies (my npm -v is 2.11.3)
In run bower install but its gives following
D:\material>bower install
bower ENOENT No bower.json present
then I run gulp docs to build docs, it was build and created /dist folder at root directory. after I run the gulp server command to live reload. Its said Webserver started at http://0.0.0.0:8080 I saw on bower but no luck, also tried alternativly as http://localhost:8080 still there is no luck.
One more alternative using httpster, I installed it and run httpster -p 8080 -d ./dist/docs it said Starting HTTPster v1.0.1 on port "8080" from ./dist/docs
again i browse localhost:8080 then its gives me error in index page on developer tool of crome as below
Uncaught Error: [$injector:nomod] http://errors.angularjs.org/1.4.3/$injector/nomod?p0=material.components.menu
angular.js:4369 Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.4.3/$injector/modulerr?p0=docsApp&p1=Error%3A…ogleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.4.3%2Fangular.min.js%3A19%3A339)
Please help what can I do to get my luck.
Paul (ngmaterial group on google) solved my problem, However site is loading demo pages not working.
Try renaming _menu.js in material-0.10.1\src\components\menu to menu-a.js. In my case that ensured the two js files were added in the correct order.

Visual Studio 2015 Remote iOS Build Server Setup - secure mode issue

I am building a hybrid mobile app (Cordova) and I am trying to run my build on iOS.
I have followed the steps in this documentation to setup my connected Mac and I can see that the Mac terminal responding when I try to build my code in visual studio.
My issue is that when ever I enable the remote build server using remotebuild --secure false I get the following error in visual studio output(notice that the terminal is responding to the build request from visual studio but then fails with errors):
Non-secure connection to http://192.168.1.10:3000/cordova could not be established. Verify that the build server is not running in secure mode.
And here is the Mac terminal activity with and output:
Last login: Tue Aug 18 19:31:21 on ttys001
IBRAHIM-ALHUSSAINs-Mac-mini:~ IBRAHIMALHUSSAIN$ remotebuild --secure false
remotebuild
Copyright (C) 2014 Microsoft Corporation. All rights reserved.
1.0.1
Warning: No server modules selected. Defaulting to configuration "modules": {"taco-remote": { "mountPath": "cordova"} }
Build Retention initialized with baseBuildDir /Users/IBRAHIMALHUSSAIN/.taco_home/remote-builds/taco-remote/builds, maxBuildsToKeep 20
Initialized BuildManager with baseBuildDir /Users/IBRAHIMALHUSSAIN/.taco_home/remote-builds/taco-remote/builds; maxBuildsInQueue 10; deleteBuildsOnShutdown true; allowsEmulate true; nextBuildNumber 423
Remote build server listening on [http] port 3000
express deprecated req.host: Use req.hostname instead ../../usr/local/lib/node_modules/remotebuild/lib/server.js:257:81
GET /modules/taco-remote 200 14.494 ms - 7
New build request submitted:
/build/tasks?command=build&vcordova=4.3.0&cfg=debug&loglevel=warn
{ 'accept-language': 'en-US',
host: '192.168.1.10:3000',
connection: 'close',
'transfer-encoding': 'chunked' }
POST /cordova/build/tasks?command=build&vcordova=4.3.0&cfg=debug&loglevel=warn - - ms - -
npm ERR! Darwin 14.3.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "taco-remote-multiplexer"
npm ERR! node v0.12.4
npm ERR! npm v2.13.4
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! syscall getaddrinfo
npm ERR! network getaddrinfo ENOTFOUND registry.npmjs.org
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! Please include the following file with any support request:
npm ERR! /Users/IBRAHIMALHUSSAIN/.taco_home/node_modules/taco-remote-multiplexer/latest/npm-debug.log
I remember reading somewhere that I should enable secure build once then disable it in order to initialize the remote server security configuration. Whenever I try to run in secure build mode remotebuild I would get this error:
Secure connection to https://192.168.1.10:3000/cordova could not be established. Verify that the build server is running in secure mode.
I have also attempted to resolve this issue by recreating PIN, generating and resetting the certificate.
How can I resolve this issue?
From the console output that you've included there, it looks like your mac can't access the npm repository:
npm ERR! network getaddrinfo ENOTFOUND registry.npmjs.org
The line stating
New build request submitted
indicates that visual studio has successfully connected to the remotebuild server and has sent over a project to be built. As part of building a project, remotebuild dynamically acquires some npm packages to make sure that it is future proof and can work with multiple different versions of Cordova.
If you are unable or unwilling to let your mac see the npm repository, then it is possible to provide your own substitute function that determines what package to load to actually build the project.
I strongly recommend against doing this, but here is the simplest way to remove the functionality:
On a machine with access to npm, "npm install taco-remote-lib" to download the default package that performs cordova builds for remotebuild, then within that "npm install cordova#<version>" for the single version you intend to use. Open up taco-remote-lib/ios/iosBuild.js and replace
TacoPackageLoader.lazyRequire("cordova", "cordova#" + cordovaVersion, buildInfo.logLevle).done(function pkg) {
cordova = pkg;
with
cordova = require("cordova");
and remove the "}, function (err) { [...] })" at the end of the function you removed.
Copy the whole taco-remote-lib folder onto the mac, as it is now a self-contained instance which is specialised to a particular cordova version
Create a new js file somewhere "myRedirector.js", and give it contents similar to the following:
.
module.exports.getPackageToServeRequest = function (request) {
return require("/path/to/copied/taco-remote-lib");
}
Create a configuration file that looks something like the following:
.
{
"modules": {
"taco-remote": {
"requirePath": "taco-remote",
"mountPath": "cordova",
"redirector": "/path/to/myRedirector.js",
}
}
}
Start remotebuild by running "remotebuild --config path/to/the/config.json"
This should start remotebuild with a custom request redirector that uses your custom modified taco-remote-lib package to build all requests.
This will not respect the version of cordova that VS specifies for builds, since that requires the ability to download those versions from NPM on demand.
perhaps because of OS have Sandbox system
In my case I had "'" in my mac's name. It did connect by host name once I removed "'".

Resources