No composer.json found in the current directory - json

Hi guys, really sorry if this has a basic answer as I'm quite new to this. I am following a YouTube tutorial Hyperledger Composer Development Tutorial (2/5) - Modeling Language (Mac OS X) https://www.youtube.com/watch?v=S2S5cEcmx7Q&t=100s.
Following all steps up to 3:22 (and tutorial 1/5) I try to command:
composer archive create -a /dist/perishables.bna --sourceType dir --sourceName
Where the result should be:
Creating Business Network Archive
Looking for package.json of Business Network Definition
Input directory: /Users/joeheade/composer-sample-networks/packages/perishable-network
Found:
Description: Shipping Perishable Goods Business Network
Name: perishable-network
Identifier: perishable-network#0.1.11
Written Business Network Definition Archive file to
Output file: ./dist/perishable-network.bna
Command succeeded
When I try, I get this:
Joe-Heades-MBP:perishable-network joeheade$ composer archive create -a /dist/perishables.bna --sourceType dir --sourceName
[Symfony\Component\Console\Exception\RuntimeException]
The "-a" option does not exist.
archive [-f|--format FORMAT] [--dir DIR] [--file FILE] [--ignore-filters] [--] [<package>] [<version>]
If I check the version I get this:
Joe-Heades-MBP:perishable-network joeheade$ composer --version
Composer version 1.5.5 2017-12-01 14:42:57
And for a generic command, I get this:
Joe-Heades-MBP:perishable-network joeheade$ composer archive create
Searching for the specified package.
No composer.json found in the current directory, searching packages from packagist.org
Could not find a package matching create.
Please could somebody help? I'm also sorry if I'm following any Stack Overflow rules incorrectly; this is my first post.
Thank you in advance!
UPDATE: In addition if I take a step back I get this result for:
Joe-Heades-MacBook-Pro:dist joeheade$ compose archive create -a dist/perishables.bna --sourceType dir --sourceName
-bash: compose: command not found
Following the steps https://github.com/composer/composer/issues/6303, I also get the following response:
Joe-Heades-MacBook-Pro:perishable-network joeheade$ composer update
Composer could not find a composer.json file in /Users/joeheade/composer-sample-networks/packages/perishable-network
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section

You've not installed Hyperledger Composer. You have installed something else called composer that also has a command line name of composer.
Please refer to the documentation website https://hyperledger.github.io/composer/ for information about Hyperledger Composer and please ensure you uninstall the dependency manager for php (called composer).

You missed a small dot(.) on this command.
Before executing this command please make sure you have a dist in this directory folder.
composer archive create --sourceType dir --sourceName . -a ./dist/perishables.bna
Use this command to create a .bna (Business Network Archive) file. This should return the expected value.

Related

OCI CLI fails to load default profile from config file even if I have proper default profile

When I run any oci cli command I'm getting below error:
ERROR: Profile '<DEFAULT>' not found in config file C:\Users\user1\.oci\config
Below is my config file for OCI CLI:
[DEFAULT]
user=<admin user ocid>
fingerprint=<fingerprint>
key_file=<path/to/private/key>
tenancy=<tenancy ocid>
region=ap-mumbai-1
I had a similar problem to this. If you use Python and have changed some of the libraries it's possible you may have updated some of the needed dependencies. Upgrade/reinstall oci ie.
pip install oci-cli --upgrade
This sorted the problem for me.
I would suggest you take a backup of this config file, delete it and reconfigure CLI automatically by executing "oci setup config"
I guest that you are using pacman to install oci-cli. You should remove it and reinstall with official method.
https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm
bash -c "$(curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)"
Please refer this document on Configuring the CLI and tally it with the config file of yours.
And refer the discussion in this forum OCI Config not found issue, this might be useful as well.

How to Install CakePHP Console?

I have a CakePHP 3.8 project hosted on github: https://github.com/paultrimor/pecunia
I can successfully clone the project, run composer install & configure app.php to have the application run.
However; the installation does not create a /bin directory, meaning that I cannot use the Console/Shell.
I am looking to install the Console on an existing CakePHP project
I receive the following message when I win composer install and `composer create-project --prefer-source``
> App\Console\Installer::postInstall
Set Folder Permissions ? (Default to Y) [Y,n]? n
Updated Security.salt value in config/app.php
> App\Console\Installer::postInstall
Set Folder Permissions ? (Default to Y) [Y,n]? n
No Security.salt placeholder to replace.
The first command replaces the "SALT" string to an actual hash in app.php; But, the second command tries to do the same thing, which it cannot.
Any pointers are appreciated. Thanks.
I think you already solved it looking at your repo, but the bin/ folder should be part of your repository. It will not be created with a composer install or composer update command.
If you create a new project using composer create-project cakephp/app --prefer-dist the bin/ executables will be placed. If you don't explicitly ignore it in .gitignore it will be available to all developers.
Step 1 : check PHP Version
php -v
Step 2: Install Composer
step 3: create a new CakePHP application using composer.
composer create-project --prefer-dist cakephp/app projectname
while installing it asking permission for folder just give yes
Set Folder Permissions ? (Default to Y) [Y,n]? Y
it will work.

No Such Module 'Alamofire'

I manually installed alamofire using the tutorial on their GitHub. It was working great until I accidentally changed what used to be Alamofire.xcodeproj to ParkR.xcodeproj. Ever since then I have received the error.
No Such Module 'Alamofire'
I would be so grateful to anyone who can solve this as I have VERY limited time to finish my project and this error has stopped me in my tracks for 5+ hours now! THANKS!
You can do it by another way by using cocoapod Depencency manager . It will take approx 10 minutes time to do . Create a new project and Just follow these steps :
1. Open the terminal and install cocoapod by just writing the command
$ gem install cocoapods
or $ sudo gem install cocoapods
After that go to the path of your project on the terminal.
$ cd "Write your path of the project or simply drag the project folder on the terminal"
Now crate the pod file by the command
$ pod init
4 . open the pod file and write your dependency name like "pod 'Alamofire' " in your case . To open pod file
$ open -a xcode podfile
and just copy past the following in your pod file (not forget to change your
target name , if you are pasting this)
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!
target '<Your Target Name>' do
pod 'Alamofire',
end
Now , install your dependencies by
$ pod install
Once the dependencies installation is successful . Close the project and open the newly crated .XCWORKSPACE file . And write import Alamofire on the top of your class . All the best and thanks

xcrun: error: unable to find utility "xcode-select", not a developer tool or in PATH

when I execute the command “pod update”,I found some problems in this process.The detail information is as follows.
$ pod update
Update all pods
Updating local specs repositories
CocoaPods 1.1.0.beta.1 is available.
To update use: gem install cocoapods --pre
[!] This is a test version we'd love you to try.
For more information see http://blog.cocoapods.org
and the CHANGELOG for this version http://git.io/BaH8pQ.
Analyzing dependencies
sh: line 1: 4173 Segmentation fault: 11 /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk / -find xcode-select 2> /dev/null
xcrun: error: unable to find utility "xcode-select", not a developer tool or in PATH
Downloading dependencies
Using AFNetworking (3.1.0)
Using MJExtension (3.0.12)
Using ReactiveCocoa (2.1.8)
Using SDWebImage (3.8.1)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 4 dependencies from the Podfile and 4 total pods installed.
$
I was struck by the problem very long .I hope for your help!Thank you in advance!
opened Xcode.
Preferences
Locations
Selected the Command Lin Tools
credit : http://www.jianshu.com/p/6b56aba2ee05

"Check Pods Manifest.lock" fails Every time i download Project from github account

I am getting following error every time i download project from Github.I tried every other solution found on google but couldn't succeed.
diff: /Users//Documents//Pods/../Podfile.lock: No such file or directory
diff: /Users//Documents//Pods/Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
Did you already create a podile?
With cocoapods installed, take the following steps:
Open a terminal window, and $ cd into your project directory (cd ~/Path/To/Folder/Containing/your/app)
Create a Podfile by running $ pod init
Open the podfile (open -a Xcode Podfile) and add the podline and save the file, for example:
pod 'AFNetworking', '~> 3.0'
Run $ pod install in your project directory
Open App.xcworkspace
Please find a more extended guide here
Hope this helps!