HyperLedger: Error when starting a Business Network - hyperledger-composer

I'm following the Developer Tutorial (https://hyperledger.github.io/composer/latest/tutorials/developer-tutorial). When I try to start the Business using -
composer network start --networkName tutorial-network --networkVersion 0.0.1 --networkAdmin admin --networkAdminEnrollSecret adminpw --card PeerAdmin#hlfv1 --file networkadmin.card, this is the error I see:
Starting business network tutorial-network at version 0.0.1
Processing these Network Admins:
userName: admin
✖ Starting business network definition. This may take a minute...
Error: Error trying to start business network. Error: No valid responses from any peers.
Response from attempted peer comms was an error: Error: 2 UNKNOWN: error starting container: Failed to generate platform-specific docker build: Error returned from build: 1 "npm ERR! code EAI_AGAIN
npm ERR! errno EAI_AGAIN
npm ERR! request to https://registry.npmjs.org/composer-common failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org:443
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-05-21T20_15_54_162Z-debug.log
"
Command failed
Error message
I'm on composer v0.19.5. This was helpful, but didn't solve my issue. I have successfully installed the network, starting it is the issue!

see the answer below -
Error in starting hyperledger fabric network with hyperledger composer
During the chaincode build, Fabric does an npm install. Looks like you're behind a proxy (npm install not being able to access https://registry.npmjs.org/ suggests you're behind a proxy and therefore it can't resolve the URL above (to pull down a Composer npm module/dependency during install)). So you would need to provide an npmrc file - in the composer network install command sequence - so that it can configure the behaviour of the npm install - and access a known registry, like https://registry.npmjs.org/ . See more information on this here -> https://hyperledger.github.io/composer/latest/managing/connector-information
example might be:
proxy="http://172.10.117.21:3128/"
https-proxy="http://172.10.117.31:3128/"
registry = "http://registry.npmjs.org/"

Related

Error during the build on the Plesk server with my Nuxt app

I have a Vue Storefront 2 project with Magento 2 as it CMS. Locally everything runs fine.
When I try to run NPM install on my Plesk server before I can build and deploy it, it gives the following error:
npm ERR! code 1
npm ERR! path /var/www/vhosts/vuestorefront2.dev/node_modules/deasync
npm ERR! command failed
npm ERR! command sh -c node ./build.js
npm ERR! linux-x64-node-16 exists; testing
npm ERR! Problem with the binary; manual build incoming
npm ERR! stdout=
npm ERR! err=Error: Command failed: /opt/plesk/node/16/bin/node quick-test.js
npm ERR! /var/www/vhosts/vuestorefront2.dev/node_modules/bindings/bindings.js:135
I have tried to remove all references of deasync in my package-lock.json.
Even though NPM install then runs and allows me to build to project afterwards, it did not load any products from Magento anymore on the deployed instance. Locally I do however fetch and display products succesfully.
When you have an issue regarding a build remotely, the first step is usually to build it locally (with something like npm run build, then run it locally npm run start) to be sure if it's a Nuxt issue or a hosting/platform issue.
Here, it looked like OP could fix his problem by forcing a specific endpoint to use the production URL. Maybe he is lacking some local server.
This fixed the issue
publicRuntimeConfig: {
middlewareUrl: process.env.NODE_ENV === "production"
? "https://example.com/api/" // Your production URL
: "http://localhost:3000/api/",
}

Running Svelte on Windows 10 - 'sirv' is not recognized as a command

I'm trying to get started with Svelte. All guides I've found list two commands as all that's required:
npm install
npm run dev
However, in Windows 10, with a fresh install of Node 12.16.3 LTS and NPM 6.14.4 (installed with NVM-Windows after uninstalling NodeJS completely, per this guide), once I hit npm run dev, I get the following errors:
$ npm run dev
> svelte-app#1.0.0 dev C:\Users\Matthew\Desktop\SvelteTest
> rollup -c -w
'rollup' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! svelte-app#1.0.0 dev: `rollup -c -w`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the svelte-app#1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Matthew\AppData\Roaming\npm-cache\_logs\2020-05-23T02_58_39_101Z-debug.log
"Hmm... Okay, that's weird, since every tutorial I've watched and guide I've read has this including in npm install, but, no worries, I'll just install rollup," I think to myself... A quick npm install -g rollup later, and the error is fixed! Good start. Sadly, this doesn't last too long, since now I run into the following issue:
$ npm run dev
> svelte-app#1.0.0 dev C:\Users\Matthew\Desktop\SvelteTest
> rollup -c -w
rollup v2.10.7
bundles src/main.js → public\build\bundle.js...
LiveReload enabled
created public\build\bundle.js in 338ms
> svelte-app#1.0.0 start C:\Users\Matthew\Desktop\SvelteTest
> sirv public "--dev"
'sirv' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! svelte-app#1.0.0 start: `sirv public "--dev"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the svelte-app#1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Matthew\AppData\Roaming\npm-cache\_logs\2020-05-23T03_00_53_008Z-debug.log
This time, no amount of npm install -g sirv will work. Is there a step I'm missing to getting this project to run?
Some notes:
I can get it to work in WSL Ubuntu 18.04 LTS, but would prefer not to have to use WSL if at all possible.
I don't see anything anywhere online that says that Windows isn't supported... is it not? Am I not looking hard enough?
When I run npm install -g rollup, I see the following warnings:
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#~2.1.2 (node_modules\rollup\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
I assume that, since this is listed as an optional dependency, it is not the source of the issue. Nonetheless, it feels silly not to bring it up — just in case. These same warnings appear during npm install.
The files npm-cahce\_logs\[datetime]-debug.log don't contain any usefull information as far as I can tell, they simply say, "sirv public "--dev" → Failed to start exec script" followed by a stack-trace.
After the second error, the program does not automatically terminate — but it is not available at localhost:5000.
I had my files in OneDrive for a while (they're now on my Desktop, which is not synced or tracked in any way), and OneDrive was upset about the files in node_modules/.bin, saying that they "couldn't be synced because of their name or type" -- this leads me to believe that perhaps this is a wider Windows/MS problem? Somehow, I doubt this is the issue.
Just to double check, I tried all of my aforementioned steps in Git Bash (my preferred terminal on Windows), CMD, and Powershell -- all exhibited the same behaviour.
Thanks in advance.
Ah, well... I feel silly now. Same issue as with Rollup — I had to install it with npm globally. But, I missed that there's both sirv and sirv-cli on NPM.
Running npm install -g sirv-cli fixed my issue.
However... I would still like to know why I don't see this issue mentioned anywhere in any guide anywhere else with all the rest of Svelte's Hello World stuff. Any information would be greatly appreciated!

Error while creating basic IBM Blockchain network on the IBM Container Service's free plan

I have created the setup from https://ibm-blockchain.github.io to launch a basic IBM Blockchain network on the IBM Container Service's free plan.
Now once setup is complete, when I am trying to deploy new network from composer, getting following error
Error: Error trying to start business network. Error: No valid responses from any peers. Response from attempted peer comms was an error: Error: 2 UNKNOWN: error starting container: Failed to generate platform-specific docker build: Error returned from build: 1 "npm ERR! code ENOTFOUND npm ERR! errno ENOTFOUND npm ERR! network request to https://registry.npmjs.org/composer-common failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443 npm ERR! network This is a problem 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! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2018-10-06T05_50_16_478Z-debug.log "
What went wrong here?
Environment - Ubuntu 16.04
The Kubernetes Cluster Service on IBM Cloud has been upgraded and no longer supports Composer. The documentation is undergoing modifications to reflect this.
Your options are to run a Development Fabric locally on your own infrastructure, or move to IBM Blockchain Starter Plan.

npm command create-react-app failled

I am trying to test reactjs on my computer (mbp pro 2017) running OsX sierra 10.12.6.
I have followed the Facebook tutorial:
Make sure you have a recent version of Node.js installed. (done)
Follow the installation instructions to create a new project. https://facebook.github.io/react/docs/installation.html#creating-a-new-application
But i have a problem on this second step !
I am not behind a proxy.
my network is ok.
The repository is set to registry.npmjs.org
i can read the url : https://registry.npmjs.org/create-react-app
But this domain is not found even on external DNS wsg.intra.corp.grp
I'am stuck, any help will be nice !
$ npm install -g create-react-app
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npmjs.org/create-react-app failed, reason: getaddrinfo ENOTFOUND wsg.intra.corp.grp wsg.intra.corp.grp:8080
npm ERR! network This is a problem 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! A complete log of this run can be found in:
npm ERR! ~/.npm/_logs/2017-09-01T08_15_13_521Z-debug.log
And the log file :
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli 'create-react-app' ]
2 info using npm#5.3.0
3 info using node#v8.4.0
4 verbose npm-session 4811d091ad74f9ef
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData error for create-react-app#latest request to https://registry.npmjs.org/create-react-app failed, reason: getaddrinfo ENOTFOUND wsg.intra.corp.grp wsg.intra.corp.grp:8080
8 verbose type system
9 verbose stack FetchError: request to https://registry.npmjs.org/create-react-app failed, reason: getaddrinfo ENOTFOUND wsg.intra.corp.grp wsg.intra.corp.grp:8080
9 verbose stack at ClientRequest.req.on.err (/usr/local/lib/node_modules/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/src/index.js:68:14)
9 verbose stack at emitOne (events.js:115:13)
9 verbose stack at ClientRequest.emit (events.js:210:7)
9 verbose stack at onerror (/usr/local/lib/node_modules/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/agent-base/index.js:106:9)
9 verbose stack at callbackError (/usr/local/lib/node_modules/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/agent-base/index.js:126:5)
9 verbose stack at <anonymous>
9 verbose stack at process._tickCallback (internal/process/next_tick.js:188:7)
10 verbose cwd /Users/franckfournier/PycharmProjects/projectX/react
11 verbose Darwin 16.7.0
12 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "create-react-app"
13 verbose node v8.4.0
14 verbose npm v5.3.0
15 error code ENOTFOUND
16 error errno ENOTFOUND
17 error network request to https://registry.npmjs.org/create-react-app failed, reason: getaddrinfo ENOTFOUND wsg.intra.corp.grp wsg.intra.corp.grp:8080
18 error network This is a problem related to network connectivity.
18 error network In most cases you are behind a proxy or have bad network settings.
18 error network
18 error network If you are behind a proxy, please make sure that the
18 error network 'proxy' config is set properly. See: 'npm help config'
19 verbose exit [ 1, true ]
You seem to be behind a corporate proxy, as wsg.intra.corp.grp:8080 is mentioned in the logs.
You need to configure the proxy like shown in this guide.
Hope this helps!
Run below commands on your command prompt. Make sure node and npm are installed.
npm config rm proxy
npm config rm https-proxy
open this link in your browser: https://registry.npmjs.org/
Run below command to set registry.
npm config set registry https://registry.npmjs.org/
Hope its help : )
I solved this issue just by,
go to settings>Network and Internet>Proxy and then off Automatically detect settings under Automatic proxy setup on Windows. And then the installation worked fine.
Following this post on Github, and adding "104.18.95.96 registry.npmjs.org" to my /etc/hosts solved my problem.
If you still face issues follow these steps:
Go to Settings > Network and Internet > Proxy and find out the address and port
Go to command prompt or terminal depending on your machine(tip: hit Win + R and type cmd). In the command prompt type the following commands
npm config set proxy http://usernamepassword#proxy-server-url:port
npm config set https-proxy http://usernamepassword#proxy-server-url:port
Username and password really isn’t needed 9 times out of 10, the last 2 will suffice. Proxy-server-url is your address and your port is the port number. Once it’s set close command prompt and re-open it. And voila! you can now install all your packages
Source: https://medium.com/#ogbemudiatimothy/using-npm-install-behind-a-corporate-proxy-server-db150c128899

ETIMEDOUT Error while installing Node packages on Windows

I am trying to install node packages on my windows machine using npm from a fresh install of node.
however, I am getting ETIMEDOUT errors. I checked few other stackoverflow questions with similar problem and almost all of them are related to problems when behind a proxy. Same is not the case with me. My system is not behind any proxy server. Can someone help me with resolving it.
PS C:\windows\system32> npm -v
2.5.1
PS C:\windows\system32> npm install bower -g
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i
nstall" "bower" "-g"
npm ERR! node v0.12.0
npm ERR! npm v2.5.1
npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! syscall connect
npm ERR! network connect ETIMEDOUT
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! C:\windows\system32\npm-debug.log
I am posting this answer in case some one faces the same issue.
I was able to solve this by running following command:
npm config delete proxy
First, run
npm config list
and check whether you are behind a proxy. If so, try running
npm config delete proxy
npm config delete http-proxy
npm config delete https-proxy
as required
**If this method did not work, reinstall nodejs.
I tried all the suggested solutions I could find on GitHub forums and StackOverflow topics. Finally disabling my router's firewall solved the issue immediately.
I am using Windows 10, node 4.0.0 and npm 2.13.4.
First see the npm config list:
npm config list
If you don't find http-proxy, https-proxy and proxy correctly set, then
You need to configure npm to work with your web proxy. For example:
npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080
npm config set http-proxy http://proxy.company.com:8080
Not on Windows but it can help there as well.
Node 16 worked, Node 18 did not. Turns out it was related to IPv6. As soon as I disabled IPv6 the connection did not timeout any more. The target registry was a Nexus server.
You can try to throttle the number of simultaneous connections with the following command (for example 3 maximum simultaneous connections):
npm set maxsockets 3
The CLI has been allowing this option since npm#3.8.0. The default is 50 simultaneous connections max. See this link for further reference.
If removing the npm proxy config settings (or correctly setting them, if that is necessary for you) did not fix it, then This github issue discusses what might be happening. My summary is that for some reason the ipv6 dns resolution to the registry is not resolving correctly and seems to be randomly failing for people.
My command was fetching from registry.npmjs.org using npm 9.1.2 and node 18.12.1 - I was running this from a windows terminal via vscode.
I ended up disabling ipv6 via the network properties of my adapter see here
Again, changing the npm config proxy settings did not resolve anything for me. I re-enabled ipv6 after my command finished.
For people working in corporates (where you cannot delete or edit the proxy configuration of the organization):
There must be an .npmrc file in your users folder. If not, you can create one. This file can be edited to register the proxy settings of your organization. Contact your organization's IT team to get the relevant proxy details.
Example of the .npmrcfile contents for my organization:
strict-ssl=false
registry=https://nexus.com/nexus/content/groups/npm-read/
proxy=http://primary-proxy.gslb.intranet.com:8080/
https-proxy=http://primary-proxy.gslb.intranet.com:8080
This file can be found in your users folder:
I was not able to install any packages before because of this error then after 1 hour, I finally resolved it because I was not behind a proxy but the proxy parameters got set in the npm config thats why that error was showing.
I'am posting it because if anyone is facing the same issue and if they are not behind any proxy then they can use the following commands:-
npm config rm proxy
npm config rm https-proxy
npm config delete http-proxy
npm config delete https-proxy
set HTTP_PROXY=null
set HTTPS_PROXY=null
One way to resolve this is to set Fiddler as your proxy server. This probably only works for windows.
Running Fiddler, type these commands:
npm config set proxy http://localhost:8888
npm config set https-proxy http://localhost:8888
Before you do this, Rules -> Automatically Authenticate
I solved with:
npm config set proxy null
I solved it with the following:
npm config rm proxy
npm config rm https-proxy
npm config delete http-proxy
npm config delete https-proxy
set HTTP_PROXY=null
set HTTPS_PROXY=null
I was going through the same error. the root cause was the proxy settings : there are several answers provided in here to reset the proxy but none of them worked for me.
Below commands solved my problem, give them a try.
npm config rm proxy
npm config rm https-proxy
If none of the mention solutions works for you then, try switching your node version.
I tried to implement all solutions and suggested commands for npm and yarn but it's not resolved.
When I disable my VPN and try to "yarn install, " it will work fine.
After all the effort with no result, I reboot my router and it works!
On windows 10, adding Node.js to the firewall authorized applications AND restarting the laptop solved the problem.
I also face this issue
Solution
Just uninstall Node.js .
uninstall its package also which you downloaded from website.
Download Node.js from website.
Reinstall Node.js .
It will Work.

Resources