fabric-composer quick-start failed on ubuntu 16.04 - hyperledger

I'm trying to follow the Fabric Composer Quickstart but failed.
Could you give me hints?
When I tried "sudo npm install", the script was completed with a few warnings.
npm WARN lifecycle getting-started#1.0.0~preinstall: cannot run in wd %s %s (wd=%s) getting-started#1.0.0 composer --version || echo 'Please first run npm install -g composer-cli' /<directory>/sample-applications/packages/getting-started
npm WARN lifecycle getting-started#1.0.0~install: cannot run in wd %s %s (wd=%s) getting-started#1.0.0 scripts/download-hyperledger.sh && scripts/start-hyperledger.sh && npm run deployNetwork /<directory>/sample-applications/packages/getting-started
When I tried "sudo composer network list -n digitalproperty-network --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d",
List business network digitalproperty-network
2017-03-21T22:44:47.360Z ERROR FSConnectionProfileStore :load() Failed to loaded connection profile defaultProfile {"0":{"stack":["{Error}ENOENT: no such file or directory, open '<directory>.composer-connection-profiles/defaultProfile/connection.json' Error: ENOENT: no such file or directory, open '<directory>.composer-connection-profiles/defaultProfile/connection.json'"," at Error (native)"]}}$
Failed to load connection profile defaultProfile
Command completed successfully.
I use
Ubuntu: 16.04
docker: 1.13.1
docker-compose: 1.11.2
node: v6.10.0
npm: 4.4.4
git: 2.11.0
composer:
composer-cli v0.5.5
composer-admin v0.5.5
composer-client v0.5.5
composer-common v0.5.5
composer-runtime-hlf v0.5.5
composer-connector-hlf v0.5.5
It looks like I have .composer-connection-profiles/defaultProfile/ direcotry but the directory don't have connection.js
How can we solve the problem? can i prepare connection.js manually?
Thank you!

This problem occurs when you run the npm install using sudo.
it shouldn't be necessary to run the commands as root so try again without using sudo and see if that helps.

This solves the problem npm install composer-connector-hlf

Related

npm throws Unknown command: "set-script" when creating new Ruby on Rails project

I am trying to create new Ruby on Rails project with:
rails new project -v 7.0.4 --css=sass --javascript=esbuild --database=mysql
And I get:
...
Add build script
run npm set-script build "esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=assets" from "."
Unknown command: "set-script"
Did you mean this?
npm run-script # Run arbitrary package scripts
...
npm version:
% npm -v
9.1.2
% which npm
/Users/foo/.nvm/versions/node/v19.1.0/bin/npm
Interesting is that nvm help doesn't even show set-script in "All commands" list.
I am on Mac M2, not sure if relevant.
I didn't find anything on google.
set-script has been deprecated as per documentation
The below should work
npm pkg set scripts.build="esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=assets"

How to solve this build error on Linux when building libsodium

I'm trying to build libsodium-sys dependency in an Azure Docker VM which is based on debian.
Have spend a couple of hours trying to fix this build error, but can't figure out what's going on.
I fixed a couple of build errors by installing missing dependencies as the Azure Docker VM seems very vanilla. Executed commands are below the error.
error: failed to run custom build command for `libsodium-sys v0.2.6 (https://github.com/cjdelisle/sodiumoxide?rev=76dc0e6e587b8c8a4bb193ebba9f8ae8f090b81b#76dc0e6e)`
Caused by:
process didn't exit successfully: `/home/packetcrypt_rs/target/release/build/libsodium-sys-169018138a0de36b/build-script-build` (exit code: 101)
checking for working alloca.h... yes
checking for alloca... yes
...
Making check in builds
--- stderr
/bin/bash: line 20: cd: builds: No such file or directory
make: *** [Makefile:516: check-recursive] Error 1
thread 'main' panicked at '
Failed to build libsodium using "make" "check" "-j4"
', /root/.cargo/git/checkouts/sodiumoxide-9b8c3ad42446e2d9/76dc0e6/libsodium-sys/build.rs:281:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed
root#2d0a725cde47:/home/packetcrypt_rs#
Build.rs file it's talking about: https://github.com/sodiumoxide/sodiumoxide/blob/master/libsodium-sys/build.rs
Executed commands:
apt get-update
apt-get install pkg-config
apt install apt-utils
apt install file
apt install gcc git
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
apt install make
apt install build-essential gcc-multilib -y
rustup target add armv7-unknown-linux-gnueabihf
git clone https://github.com/cjdelisle/packetcrypt_rs
cd packetcrypt_rs
~/.cargo/bin/cargo build --release
The cause seems related to the issue explained here: https://gitlab.com/gitlab-org/gitlab-runner/-/issues/1379#note_280986944
For reasons unbeknownst to me, these are the commands I needed to execute to fix it:
rm ~/.bashrc
rm ~/.profile

"cdk" command not found after installing python version

The "cdk" command is not found after installing with "pip install --upgrade aws-cdk.core" (per the docs).
The package successfully installs because it is found in the "site-packages" directory.
tennis.smith at C02TM089GY6N in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
$ ls
README.txt cattr/ docopt-0.6.2.dist-info/ pip/ requests-2.22.0.dist-info/ typing_extensions.py
__pycache__/ cattrs-0.9.0.dist-info/ docopt.py pip-19.3.dist-info/ setuptools/ urllib3/
attr/ certifi/ easy_install.py pkg_resources/ setuptools-41.2.0.dist-info/ urllib3-1.25.6.dist-info/
attrs-19.3.0.dist-info/ certifi-2019.9.11.dist-info/ idna/ publication-0.0.3.dist-info/ six-1.12.0.dist-info/ wheel/
aws_cdk/ chardet/ idna-2.8.dist-info/ publication.py six.py wheel-0.33.6.dist-info/
aws_cdk.core-1.13.1.dist-info/ chardet-3.0.4.dist-info/ jsii/ python_dateutil-2.8.0.dist-info/ tests/ yarg/
aws_cdk.cx_api-1.13.1.dist-info/ dateutil/ jsii-0.19.0.dist-info/ requests/ typing_extensions-3.7.4.dist-info/ yarg-0.1.9.dist-info/
Any ideas why it isn't being detected?
To install the CDK CLI run npm install -g aws-cdk.

Ios-deploy install doesn't work - macOS High Sierra (10.13.5)

Command line arguments than I used for ios-deploy.
sudo npm install -g ios-deploy --unsafe-perm --allow-root
Expected behavior
Install ios-deploy global via NPM
Actual behavior.
Ios-deploy not installed and get the error 65:
/bin/sh -c /usr/local/lib/node_modules/ios-deploy/build/ios-deploy.build/Release/ios-deploy.build/Script-C0CD3D981F59D20100F954DB.sh
cp: /System/Library/PrivateFrameworks/MobileDevice.framework/XPCServices: No such file or directory
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution Run\ Script build/ios-deploy.build/Release/ios-deploy.build/Script-C0CD3D981F59D20100F954DB.sh
(1 failure)
npm ERR! code ELIFECYCLE
npm ERR! errno 65
npm ERR! ios-deploy#1.9.2 preinstall: ./src/scripts/check_reqs.js && xcodebuild
npm ERR! Exit status 65
npm ERR!
npm ERR! Failed at the ios-deploy#1.9.2 preinstall 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! /Users/vinicius/.npm/_logs/2018-06-20T10_50_13_426Z-debug.log
Steps to reproduce the problem
I run the command: npm install -g ios-deploy
System Specs
system_profiler SPSoftwareDataType
System Version: macOS 10.13.5 (17F77)
Kernel Version: Darwin 17.6.0
Boot Volume: Macintosh HD
Boot Mode: Normal
Computer Name: Mac mini de Vinicius
User Name: Vinicius Ribeiro (vinicius)
Secure Virtual Memory: Enabled
System Integrity Protection: Enabled
Time since boot: 36 minutes
ios-deploy -V
-bash: ios-deploy: command not found
3. xcodebuild -version
Xcode 9.4.1
Build version 9F2000
4. xcode-select --print-path
/Applications/Xcode.app/Contents/Developer
gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin17.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
lldb --version
lldb-902.0.79.7
Swift-4.1
Removed XPCServices file, and the install worked;
https://github.com/ios-control/ios-deploy/issues/346
I know very little about npm install, but I have found that when blocked from an installation on High Sierra, such as when updating ruby gems, a simple solution is to turn off SIP temporarily.

Error running 'ionic emulate ios' command

I've installed and build ios and all seems ok but when I run 'ionic emulate ios' I get the following error (just running it for the demo myApp):
Updated the hooks directory to have execute permissions
Running command: /Users/X/myApp/hooks/after_prepare/010_add_platform_class.js /Users/X/myApp
add to body class: platform-ios
Running command: /Users/X/myApp/platforms/ios/cordova/run --emulator
/bin/sh: ios-sim: command not found
Error: /Users/X/myApp/platforms/ios/cordova/run: Command failed with exit code 2
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
Anyone have any ideas?
Did you installed ios-sim?
sudo npm install -g ios-sim
Fix the hooks error permission:
chmod +x hooks/after_prepare/*
First, it seems that you do not give 'execute permission' to cordova hooks, so just run:
chmod -R +x hooks/after_prepare
more about hooks issues: http://ionicframework.com/docs/ionic-cli-faq/#hooks.
Secondly, use ionic cli start ios simulator, you must install a utility package called ios-sim:
sudo npm install -g ios-sim
more about ios emulation:http://ionicframework.com/docs/ionic-cli-faq/#ios-emulate.
Hope this will help you. Regards.

Resources