How to install league/OAuth2-client through composer - oauth-2.0

I am getting an error while trying to install league/oauth2-client through composer on ubuntu with newest curl and openssl libraries combined with newest php release:
$ composer require league/oauth2-client
Using version ^0.12.1 for league/oauth2-client
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for league/oauth2-client 1.0.x-dev -> satisfiable by league/oauth2-client[1.0.x-dev].
- Can only install one of: league/oauth2-client[0.12.1, 1.0.x-dev].
- Installation request for league/oauth2-client ^0.12.1 -> satisfiable by league/oauth2-client[0.12.1].
Installation failed, reverting ./composer.json to its original content.
could not find any hint through searching for answers so far. Thank you in advance for any heop on this!
cotent of composer.json
$ cat composer.json
{
"name": "league/oauth2-client",
"description": "OAuth 2.0 Client Library",
"license": "MIT",
"require": {
"php": ">=5.5.0",
"ext-curl": "*",
"ircmaxell/random-lib": "~1.1",
"guzzlehttp/guzzle": "~6.0"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"mockery/mockery": "~0.9",
"squizlabs/php_codesniffer": "~2.0",
"satooshi/php-coveralls": "0.6.*",
"jakub-onderka/php-parallel-lint": "0.8.*"
},
"keywords": [
"oauth",
"oauth2",
"authorization",
"authentication",
"idp",
"identity",
"sso",
"single sign on"
],
"authors": [
{
"name": "Alex Bilbie",
"email": "hello#alexbilbie.com",
"homepage": "http://www.alexbilbie.com",
"role": "Developer"
}
],
"autoload": {
"psr-4": {
"League\\OAuth2\\Client\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"League\\OAuth2\\Client\\Test\\": "test/src/"
}
},
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
}
}

I think you are using composer wrong. Try running composer install
From the composer documentation:
The require command adds new packages to the composer.json file from
the current directory. If no file exists one will be created on the
fly.
The install command reads the composer.json file from the current
directory, resolves the dependencies, and installs them into vendor.
So if the composer.json is that of league/oauth2-client, just run composer install
If you want league/oauth2-client to be added as a dependency for some other package, run composer require league/oauth2-client

I have fixed this installing knpuniversity/oauth2-client-bundle first. So you need to follow this order:
composer require knpuniversity/oauth2-client-bundle
composer require league/oauth2-client
composer require league/oauth2-facebook
This is my composer.json file after installing:
{
"knpuniversity/oauth2-client-bundle": "^1.9",
"league/oauth2-client": "^2.2",
"league/oauth2-facebook": "^2.0"
}
Hope it helps

Related

electron-forge: npm run make creates an app with a white screen

I created a template with npx create-electron-app my-new-app --template=typescript-webpack (from https://www.electronforge.io/templates/typescript-+-webpack-template). I adapted the package.json like this (in order to get rid of an error):
"plugins": [
{
"name": "#electron-forge/plugin-webpack",
"config": {
"mainConfig": "./webpack.main.config.js",
"renderer": {
"config": "./webpack.renderer.config.js",
"entryPoints": [
{
"html": "./src/index.html",
"js": "./src/renderer.ts",
"name": "main_window",
"preload": {
"js": "./src/preload.ts"
}
}
]
}
}
}
]
When I run npm run make, electron forge builds an app that has a white screen(missing all the content).
Update: after installing npm install -g #electron-forge/cli#beta
and running electron-forge make instead of npm run make I get this:
✔ Checking your system
✖ Resolving Forge Config
Electron forge was terminated:
Expected plugin to either be a plugin instance or [string, object] but found [object Object]
This seems to be a bug in the latest #electron-forge version.
Please follow the below steps to resolve this issue.
Delete the below files and folders
package-lock.json
node_modules
.webpack
Change all the #electron-forge versions in packages.json to 6.0.0-beta.63.
"devDependencies": {
"#electron-forge/cli": "6.0.0-beta.63",
"#electron-forge/maker-deb": "6.0.0-beta.63",
"#electron-forge/maker-rpm": "6.0.0-beta.63",
"#electron-forge/maker-squirrel": "6.0.0-beta.63",
"#electron-forge/maker-zip": "6.0.0-beta.63",
"#electron-forge/plugin-webpack": "6.0.0-beta.63",
Make sure you do not have ^ in front of the version numbering. Or else, it will fetch the latest version.
Modify the plugins section as shown below.
"plugins": [
[
"#electron-forge/plugin-webpack",
{
"mainConfig": "./webpack.main.config.js",
"renderer": {
"config": "./webpack.renderer.config.js",
"entryPoints": [{
"name": "main_window",
"html": "./src/index.html",
"js": "./src/renderer.ts",
"preload": {
"js": "./src/preload.ts"
}
}]
}
}
]
]
Now install the packages
npm install
or, if you use yarn
yarn install
Now you should be able to see the page when you do an npm run make.

npm run make is not working in electron-forge

I have created and electron application and trying to use electron forge for building purpose.
Please find below command which i have run it for creating the electron application:
#npm i -g create-react-app
#npm i -g #electron-forge/cli
#npx create-electron-app my-ele-app
The above last command created a project my-ele-app. and now i am able to start the application as well.
#npm start.
content of package.json file is:
{
"name": "my-ele-app",
"productName": "my-ele-app",
"version": "1.0.0",
"description": "My Electron application description",
"main": "src/index.js",
"scripts": {
"start": "electron-forge start",
"package": "electron-forge package",
"make": "electron-forge make",
"publish": "electron-forge publish",
"lint": "echo \"No linting configured\""
},
"keywords": [],
"author": {
"name": "rohit",
"email": "rohit#xyz.com"
},
"license": "MIT",
"config": {
"forge": {
"packagerConfig": {},
"makers": [
{
"name": "#electron-forge/maker-squirrel",
"config": {
"name": "my_ele_app"
}
},
{
"name": "#electron-forge/maker-zip",
"platforms": [
"darwin"
]
},
{
"name": "#electron-forge/maker-deb",
"config": {}
},
{
"name": "#electron-forge/maker-rpm",
"config": {}
}
]
}
},
"dependencies": {
"electron-squirrel-startup": "^1.0.0"
},
"devDependencies": {
"#electron-forge/cli": "^6.0.0-beta.55",
"#electron-forge/maker-deb": "^6.0.0-beta.55",
"#electron-forge/maker-rpm": "^6.0.0-beta.55",
"#electron-forge/maker-squirrel": "^6.0.0-beta.55",
"#electron-forge/maker-zip": "^6.0.0-beta.55",
"electron": "12.0.9"
}
}
Now when i am running below command, it is throwing error:
#npm run make
Error is:
> my-ele-app#1.0.0 make
> electron-forge make
√ Checking your system
√ Resolving Forge Config
An unhandled rejection has occurred inside Forge:
Error: Could not find module with name: #electron-forge/maker-squirrel. Make sure it's listed in the devDependencies of your package.json
at _default (C:\Users\212807091\Desktop\Rohit\Office Note\RBAC\Electron_project\npx_electrong\my-ele-app\node_modules\#electron-forge\core\src\api\make.ts:125:15)
at C:\Users\212807091\Desktop\Rohit\Office Note\RBAC\Electron_project\npx_electrong\my-ele-app\node_modules\#electron-forge\cli\src\electron-forge-make.ts:44:5
Electron Forge was terminated. Location:
{}
NOTE: i can see there is module available in node_modules folder:
my-ele-app\node_modules#electron-forge\maker-squirrel
If anyone here has any idea how to fix this issue. please provide the answer. Thanks!
In my cases, it makes error when the description or author is empty in package.json file.
I got the same error after following the "Getting Started" instructions. Nothing resolved it until I ran npm install -g #electron-forge/cli#beta -- after that finished I was able to successfully run electron-forge make.
Also running npm run make did the same as electron-forge make as I didn't appear to have it installed. Another thing I noticed is that if I run npm run make with maker-squirrel at version 6.0.0-beta.55 then I get this error: Could not find module with name: #electron-forge/maker-squirrel. However, if I re-install maker-squirrel as npm install --save-dev #electron-forge/maker-squirrel#6.0.0-beta.33 and re-run npm run make then I get an out folder with an exe.
you have installed all the required dependencies so just run this command
npm run package
And after this a folder with name out is generated and inside that your .exe file will be present
I had a similar issue but I followed the instructions from here: https://www.electronjs.org/docs/latest/tutorial/quick-start#package-and-distribute-your-application
I missed calling npx electron-forge import. So the full pipeline looks like this:
npm install --save-dev #electron-forge/cli
npx electron-forge import
npm run make
Check the documentation. i solve same problem with this
If you are using Windows, this works for me:
Run npm i electron-winstaller --save-dev --ignore-scripts
Install 7zip x86 in your computer. After installed, go to C:\Program Files (x86)\7-Zip and copy both 7z.dll and 7z.exe files to /path/to/your_project/node_modules/electron-winstaller/vendor if they are not still there.
Run npm electron-forge import again
Then try run npm run make again. I hope it works.

Can not install older version of Electron through package.json

Since the current VS code doesn't support Electron v1.6, so I have to downgrade my Electron version. However, I found that I can not install the old version of Electron by giving the version number in the package.json file. The following is my configuration:
{
"name": "Example",
"version": "1.0.0",
"description": "",
"main": "./app/main.js",
"scripts": {
"postinstall": "install-app-deps",
"start": "electron ."
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"electron-builder": "^15.5.1",
"electron": "^1.4",
"electron-rebuild": "^1.5.7"
},
"dependencies": {
"jquery": "^3.1.1",
"sqlite3": "^3.1.8"
}
}
The output of the npm install is the following:
And I run the following command to check the version of Electron:
node_modules/.bin/electron -v
and the output is '1.6.2' which is the latest version of Electron.
What's more interesting is that I can install the old version of Electron successfully by directly running the following command:
npm install electron#1.4
So I want to if there is anything wrong in my package.json file which caused this problem. And if so, how can I fix it.
Actually, the Electron version 1.6 satisfies "^1.4" because the caret tells NPM the minimal version of the package to install.
As also written in an answer to the Microsoft issue on GitHub, you might use "1.4" or "~1.4.0" in order to get Electron 1.4 or any other 1.4.x version (the tilde is for minimal minor releases as shown in the NPM documentation for the cli-based update of packages).

Trying to install oAuth package using composer

I'm trying to install the following using composer:
https://github.com/Lusitanian/PHPoAuthLib
I tried using:
"lusitanian/oauth": "~0.3"
but that didn't work, the version being used now was something I found online that supposedly works.
When I try to run the following composer install commmand I get a message saying that the package couldn't be found. It doesn't appear in the composer.json file (not sure if its meant to). This is the first time I've tried to install this so any tips on getting this working would be much appreciated.
php composer.phar install
Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package lusitanian/oauth 1.0.0 could not be found.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion for more details.
Read http://getcomposer.org/doc/articles/troubleshooting.md for further common problems.
{
"name": "lusitanian/oauth",
"description": "PHP 5.3+ oAuth 1/2 Library",
"keywords": ["oauth", "authentication", "authorization", "security"],
"license": "MIT",
"authors": [
{
"name": "David Desberg",
"email": "david#daviddesberg.com"
},
{
"name": "Pieter Hordijk",
"email": "info#pieterhordijk.com"
}
],
"require": {
"php": ">=5.3.0",
"lusitanian/oauth": "0.1.*#dev"
},
"require-dev": {
"symfony/http-foundation": "~2.1",
"predis/predis": "0.8.*#dev",
"phpunit/phpunit": "3.7.*"
},
"suggest": {
"symfony/http-foundation": "Allows using the Symfony Session storage backend.",
"predis/predis": "Allows using the Redis storage backend.",
"ext-openssl": "Allows for usage of secure connections with the stream-based HTTP client."
},
"autoload": {
"psr-0": {
"OAuth": "src",
"OAuth\\Unit": "tests"
}
},
"extra": {
"branch-alias": {
"dev-master": "0.1-dev"
}
}
}
Changing this:
"lusitanian/oauth": "0.1.*#dev"
to this:
"lusitanian/oauth": "1.0.*#dev"
Fixed it :)

Installing SpeckPaypal Module into ZF2

I am having issues with installing this module into ZF2 via composer. I have edited the composer.json file that comes with zend framework 2 but it won't install when I run the command php composer.phar install.
Here is what my composer.json file looks like:
"name": "speckcommerce/speck-paypal",
"description": "A generic module for adding PayPal support to a ZF2 application.",
"type": "library",
"keywords": [
"zf2"
],
"homepage": "http://github.com/speckcommerce/SpeckPaypal",
"authors": [
{
"name": "Stephen Rhoades",
"email": "steve#stephenrhoades.com",
"homepage": "http://www.stephenrhoades.com"
}
],
"require": {
"php": ">=5.4",
"zendframework/zendframework": "2.*"
},
"autoload": {
"psr-0": {
"SpeckPaypal": "src/"
},
"classmap": [
"./"
]
}
The source can be found at: https://github.com/speckcommerce/SpeckPaypal
Thanks!
You are supposed to
composer require speckcommerce/speck-paypal:dev-master
from your project root. The composer.json from the SpeckPaypal Module won't help you there :D
Dunno if you are still struggling with this; but it appears that speck's composer json is not quite correct.
The accepted structure for a ZF2 module leaves module.php outside the scope of the standard psr-0 autoloader; most modules define ./Module.php in their classmap section see https://github.com/zendframework/ZendDeveloperTools/blob/master/composer.json as an example.

Resources