Running the 'Getting-Started' Fabric Composer gets error with composer archive create; missing required options - hyperledger-composer

Sequence of steps was
npm install -g composer-cli
Clone the getting started repository, and issue npm install
Lots of NPM errors are output, but some of the key ones are.
> composer archive create -m digitalproperty-network --archiveFile digitalPropertyNetwork.bna && composer network deploy --archiveFile digitalPropertyNetwork.bna --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d && composer network list -n digitalproperty-network --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d
composer archive create --archiveFile digitialPropertyNetwork.zip --sourceType module --sourceName digitalproperty-network
Options:
--help Show help [boolean]
-v, --version Show version number [boolean]
--archiveFile, -a Business network archive file name. Default is based on the Identifier of the BusinessNetwork [string]
--sourceType, -t The type of the input containg the files used to create the archive [ module | dir ] [required]
--sourceName, -n The Location to create the archive from e.g. NPM module directory or Name of the npm module to use [required]
Missing required arguments: sourceType, sourceName
npm ERR! Linux 4.8.0-39-generic
npm ERR! argv "/home/matthew/.nvm/versions/node/v6.10.0/bin/node" "/home/matthew/.nvm/versions/node/v6.10.0/bin/npm" "run" "deployNetwork"
npm ERR! node v6.10.0
npm ERR! npm v4.3.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! getting-started#1.0.0 deployNetwork: `composer archive create -m digitalproperty-network --archiveFile digitalPropertyNetwork.bna && composer network deploy --archiveFile digitalPropertyNetwork.bna --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d && composer network list -n digitalproperty-network --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d`
npm ERR! Exit status 1
The machine is clean, with no caches. Some of the other sample networks are also failing with the same error?

When the npm install -g composer-cli was issued, it installed a version of the command line tools that was at v0.4.5 or later. composer --version outputs for example.
$ composer --version
composer-cli v0.4.5
composer-admin v0.4.5
composer-client v0.4.5
composer-common v0.4.5
composer-runtime-hlf v0.4.5
composer-connector-hlf v0.4.5
The composer archive create command needs to form up the Business Network Archive from the model files, transaction files etc. It can do this in two ways
by taking a source directory
by taking a module name
The new syntax of the command is
composer archive create --archiveFile digitialPropertyNetwork.zip --sourceType module --sourceName digitalproperty-network
Options:
--help Show help [boolean]
-v, --version Show version number [boolean]
--archiveFile, -a Business network archive file name. Default is based on the Identifier of the BusinessNetwork [string]
--sourceType, -t The type of the input containg the files used to create the archive [ module | dir ] [required]
--sourceName, -n The Location to create the archive from e.g. NPM module directory or Name of the npm module to use [required]
Previously there was a --moduleName and a --inputDir name.
Examples:
To create a business network archive from the current working directory previously would have used the --inputDir . the new command is:
composer archive create --sourceType dir --sourceName . --archiveFile digitialPropertyNetwork.bna
To create a business network archive by indicating the NPM Module containing the business network would have used the --moduleName digitalproperty-network the new command is:
composer archive create --sourceType module --sourceName digitialproperty-network --archiveFile digitialPropertyNetwork.bna
In both cases above the --archiveFile digitialPropertyNetwork.bna is optional. A default filename will be created from the name of the Business Network if needed.
Why?
The inputDir and moduleName options were mutually exclusive and the internal code design was not proving resilient to handling error cases. The new approach to the options simplifies (and increases the resilience of the code).
Depending on the development approach, the artifacts that make up the business network may be created in different ways. By moving to this new style of options means we aren't precluding any other 'sourceType'. In the previous model, we would have had to add more and more command line options.

Related

How to build a un-minified version of Shopware 6 administration scripts for debugging purpose?

I would like to debug the following not-very-helpful error message when trying to save a custom CMS component in Shopware 6 administration layout editor:
An error was captured in current module: undefined
errorCaptured # app.js?16504701226454027:1
Xe # vendors-node.js?16504701221582962:2
(anonymous) # vendors-node.js?16504701221582962:2
Promise.catch (async)
Ge # vendors-node.js?16504701221582962:2
n # vendors-node.js?16504701221582962:2
o._wrapper # vendors-node.js?16504701221582962:2
When having such problems in the store front, I usually modify build-storefront.sh to call
npm --prefix "${STOREFRONT_ROOT}"/Resources/app/storefront run development
instead of
npm --prefix "${STOREFRONT_ROOT}"/Resources/app/storefront run production
Now I want to adapt build-administration.sh in a similar way:
The original line is
(cd "${ADMIN_ROOT}"/Resources/app/administration && npm clean-install && npm run build)
When I change it to
(cd "${ADMIN_ROOT}"/Resources/app/administration && npm install && mode=development npm run dev)
I would call
"dev": "mode=development webpack-dev-server",
vendor/shopware/administration/Resources/app/administration/package.json
I do not want to use the dev server and changed this to
"dev": "mode=development webpack",
No the build runs, but I still get a minified app.js as a result.
How can I debug the initial problem further?

How to fix EACCES: permission denied, open '/Users/.... when installing gatsby-cli

I'm setting up Gatsby and get stuck at the beginning.
When i write npx/npm install global gatsby-cli in the terminal -
Alems-MacBook-Pro:~ alemkahrobek$ npm install -g gatsby-cli i see this:
/usr/local/bin/gatsby -> /usr/local/lib/node_modules/gatsby-cli/lib/index.js
gatsby-telemetry#1.0.4 postinstall /usr/local/lib/node_modules/gatsby-cli/node_modules/gatsby-telemetry
node src/postinstall.js
gatsby-cli#2.5.4
added 225 packages from 131 contributors in 13.617s.
If i check the version of gatsby i get this:
Alems-MacBook-Pro:~ alemkahrobek$ gatsby -v
/usr/local/lib/node_modules/gatsby-cli/node_modules/configstore/index.js:49
throw error;
^
Error: EACCES: permission denied, open '/Users/alemkahrobek/.config/gatsby/config.json'
You don't have access to this file.
at Object.openSync (fs.js:439:3)
at Object.readFileSync (fs.js:344:35)
at Configstore.get all [as all] (/usr/local/lib/node_modules/gatsby-cli/node_modules/configstore/index.js:31:25)
at new Configstore (/usr/local/lib/node_modules/gatsby-cli/node_modules/configstore/index.js:25:48)
at new Store (/usr/local/lib/node_modules/gatsby-cli/node_modules/gatsby-telemetry/lib/store.js:28:51)
at new EventStorage (/usr/local/lib/node_modules/gatsby-cli/node_modules/gatsby-telemetry/lib/event-storage.js:24:50)
at new AnalyticsTracker (/usr/local/lib/node_modules/gatsby-cli/node_modules/gatsby-telemetry/lib/telemetry.js:32:50)
at Object.<anonymous> (/usr/local/lib/node_modules/gatsby-cli/node_modules/gatsby-telemetry/lib/index.js:7:18)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10).
Now if i try to make a new project like:
gatsby new example
i get this:
Alems-MacBook-Pro:~ alemkahrobek$ npm gatsby new example
Usage: npm <command>
where <command> is one of:
access, adduser, audit, bin, bugs, c, cache, ci, cit,
clean-install, clean-install-test, completion, config,
create, ddp, dedupe, deprecate, dist-tag, docs, doctor,
edit, explore, get, help, help-search, hook, i, init,
install, install-ci-test, install-test, it, link, list, ln,
login, logout, ls, org, outdated, owner, pack, ping, prefix,
profile, prune, publish, rb, rebuild, repo, restart, root,
run, run-script, s, se, search, set, shrinkwrap, star,
stars, start, stop, t, team, test, token, tst, un,
uninstall, unpublish, unstar, up, update, v, version, view,
whoami
npm <command> -h quick help on <command>
npm -l display full usage info
npm help <term> search for help on <term>
npm help npm involved overview
Specify configs in the ini-formatted file:
/Users/alemkahrobek/.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config
npm#6.9.0 /usr/local/lib/node_modules/npm
Alems-MacBook-Pro:~ alemkahrobek$ npm help config
NPM-CONFIG(1) NPM-CONFIG(1)
NAME
npm-config - Manage the npm configuration files
SYNOPSIS
npm config set <key> <value> [-g|--global]
npm config get <key>
npm config delete <key>
npm config list [-l] [--json]
npm config edit
npm get <key>
npm set <key> <value> [-g|--global]
aliases: c
DESCRIPTION
npm gets its config settings from the command line, environment vari-
ables, npmrc files, and in some cases, the package.json file.
See npm help 5 npmrc for more information about the npmrc files.
See npm help 7 npm-config for a more thorough discussion of the mechanisms involved.
The npm config command can be used to update and edit the contents of
the user and global npmrc files.
Sub-commands
Config supports the following sub-commands:
set
npm config set key value
Sets the config key to the value.
If value is omitted, then it sets it to "true".
get
npm config get key
Echo the config value to stdout.
list
npm config list
Show all the config settings. Use -l to also show defaults. Use --json
to show the settings in json format.
delete
npm config delete key
Deletes the key from all configuration files.
edit
npm config edit
Opens the config file in an editor. Use the --global flag to edit the
global config.
SEE ALSO
o npm help 5 folders
o npm help 7 config
o npm help 5 package.json
o npm help 5 npmrc
For Ubuntu users who experience the same problem, I've solved it giving the right permissions on the specified folder:
chown -R $USER:$USER /home/$USER/.config/gatsby
Check out the official page on npmjs.com: https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally
I would definitely the first option on that page. nvm is pretty awesome: https://github.com/creationix/nvm

Laravel error when running npm run dev command

When I run npm run dev in the terminal I get the following message:
ERROR in ./resources/js/components/ExampleComponent.vue
Module build failed (from ./node_modules/vue-loader/lib/index.js):
Error: [vue-loader] vue-template-compiler must be installed as a peer dependency, or a compatible compiler implementation must be passed via options.
at loadTemplateCompiler (/portal/node_modules/vue-loader/lib/index.js:21:11)
at Object.module.exports (
(/portal/node_modules/vue-loader/lib/index.js:65:35)
# ./resources/js/app.js 19:35-79
# multi ./resources/js/app.js ./resources/sass/app.scss
Can anyone tell me what this error means and how do I fix it?
I tried to run this command in the terminal, but I am still getting the error.
The command: npm i -D vue-template-compiler
I have also tried to reinstall all of my dependencies, but that didnt work either.

Failed at the # production script. Error running npm run production

I am facing issue while using the following command
npm run production
after execute following command i see following error
ERROR Failed to compile with 5 errors
error in ./resources/assets/sass/app.scss
Module build failed: ModuleBuildError: Module build failed: TypeError: Cannot read property 'map' of undefined
at preparePluginsArray (E:\wamp\www\smm.yasmalik.com\node_modules\svgo\lib\svgo\config.js:64:20)
at module.exports (E:\wamp\www\smm.yasmalik.com\node_modules\svgo\lib\svgo\config.js:32:28)
at new module.exports (E:\wamp\www\smm.yasmalik.com\node_modules\svgo\lib\svgo.js:21:19)
at E:\wamp\www\smm.yasmalik.com\node_modules\postcss-svgo\dist\index.js:95:16
at Object.creator [as postcssSvgo] (E:\wamp\www\smm.yasmalik.com\node_modules\postcss-svgo\node_modules\postcss\lib\postcss.js:150:35)
at E:\wamp\www\smm.yasmalik.com\node_modules\cssnano\dist\index.js:295:40
at Array.forEach (<anonymous>)
at E:\wamp\www\smm.yasmalik.com\node_modules\cssnano\dist\index.js:282:29
at creator (E:\wamp\www\smm.yasmalik.com\node_modules\cssnano\node_modules\postcss\lib\postcss.js:150:35)
at processCss (E:\wamp\www\smm.yasmalik.com\node_modules\css-loader\lib\processCss.js:199:16)
It was issue with my node_modules folder. there were some extra useless packages so simply i just deleted node_modules and install it again with following commands
Step 1
Delete node_modules manually
Step 2
Install the node_modules folder again:
npm i
Step 3
Update existing packages
npm update
That's it!
Probably you have some conflicts with versions of some npm packages.
Try to reinstall npm:
rm -rf node_modules
npm install

how deploying importing busines network on hyperledger composer?

how to deploy the business network on hyperledger composer through cli?
student-business-network#0.0.2-deploy.3 prepublish /home/user/Downloads/student-business-network.bna_FILES
mkdirp ./dist && composer archive create --sourceType dir --sourceName . -a ./dist/unnamed-network.bna
Creating Business Network Archive
Looking for package.json of Business Network Definition
Input directory: /home/user/Downloads/student-business-network.bna_FILES
Found:
Description: Start from scratch with a blank business network
Name: student-business-network
Identifier: student-business-network#0.0.2-deploy.3
Written Business Network Definition Archive file to
Output file: ./dist/unnamed-network.bna
Command succeeded
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN student-business-network#0.0.2-deploy.3 license should be a valid SPDX license expression
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
added 933 packages from 1011 contributors and audited 15581 packages in 47.456s
found 111 vulnerabilities (71 low, 26 moderate, 13 high, 1 critical)
run npm audit fix to fix them, or npm audit for details
user#finatel:~/Downloads/student-business-network.bna_FILES$ composer runtime install --card PeerAdmin#hlfv1 --businessNetworkName student-network && composer network start --card PeerAdmin#hlfv1 --networkAdmin admin --networkAdminEnrollSecret adminpw --archiveFile student-business-network.bna --file networkadmin.card && composer card import --file networkadmin.cardcomposer hiveFile student-business-network.bna --file networkadmin.card
I would suggest you read the hyperledger composer documentation and specifically follow the tutorials in the documentation to help you get started.
documentation can be found here https://hyperledger.github.io/composer/latest/
tutorials are here https://hyperledger.github.io/composer/latest/tutorials/tutorials.html

Resources