Drupal 9 - Unable to install package with composer - drupal

How can I add a new package to the vendor folder by using the composer. I tried to use the composer command composer require [package-name]. However, I tried but I was getting an error telling me "./compose.json" is not a UTF-8. After several attempts to configure some PHP options and execute the same command, the package was downloaded, but in a different path than the drupal-9.x.x/vendor/package-name-folder path. But there is another path inside the drupal-9.x.x/core folder. The package name is included in the composer.json file in the drupal-9.x.x/core folder path.
The question here is how can I insert a new package using the composer command into the Drupal project, and is it possible to link this package to a custom module so that it is from the installation dependencies?

I found the problem seems to be related to eclipse ide and trying to open the composer .json file through the ide and using the ide options to download and install the package
What I did was use the git bash and I executed the composer command and the package was downloaded as required

Related

Upgrade sqlite3 to custom package

I have a server running centos7 with sqlite3 installed using Yum/rpm. By default the sqlite package is not compiled with the extension JSON1 which I need. The extension can be enabled when the package is compiled using the flag -DSQLITE_ENABLE_JSON1 After working at it for a full day I've managed to find the RPM source files, updated the spec so it compiles with the flag, and recompiled it into a new package. Now I can run rpm -U current-sqlite-package.rpm custom-sqlite-package.rpm and upgrade to my custom package. Both yum and rpm say that the package but when I run /user/bin/sqlite3 --version it is still the old version.
How do I upgrade to my custom package?
How does yum/rpm packages tie to the software in /user/bin?
Current versions of SQLite3 support runtime extension loading. So you can just download and compile the JSON1 extension as a separate .so file and load it via .load ~/path/to/json1.so
This will allow you to receive updates for SQLite via the default package manager and no need to rebuild it yourself.

installing github project as a meteor package

I forked a meteor package on github at https://github.com/kfirufk/angular2-meteor-accounts-ui
now I want to install it on a meteor project that I have. there are tons of information on the net, some recommend using meteorite, others recommend using mgp... but all the information that i find is for very old version of meteor and nothing actually works!
any information regarding the issue would be greatly appreciated.
update
I created packages directory inside the root directory and cloned the github package to that directory.
I edited .meteor/packages file and added angular2-meteor-accounts-ui.
now when i run the meteor application i get the following error:
While selecting package versions:
error: unknown package in top-level dependencies:
angular2-meteor-accounts-ui
angular2-meteor-accounts-ui is the name of the package of the github project i cloned (in package.json).
If I understand the question correctly, this is the procedure I've done myself, and it works:
Stop the app
edit the packages file and add the package name of your git fork
clone your git fork inside the packages folder of your meteor project. When you start meteor, packages inside that folder take precedence over the Internet, so once it finds the package there, it will not check the one in atmospherejs for download.
Note: if you want the package to be part of your project code, just remove .git inside the package clone, and add the whole folder to your app repo.

what would I use for a meteor package manager

I understand meteor has their own package manager under the covers (that way meteor deploy works to include the packages) but I'm looking for a package manager for meteor. By package manager, i'm looking for like bundler/gemfile (ruby) or maven/pom file (java).
Again I understand the meteor install works fine, but I want to define my own "private" packages as well as have a file to put the package declarations in so when I go to update I can do it easily.
I saw meteorite, but I also read where as of meteor 0.9.0 it is no longer needed.
Thanks!
EDIT:
so for example, in ruby you have the bundler gem which has a gemfile. in the gemfile you put
source 'https://rubygems.org'
gem '<gem_name>','<gem_version>'
gem '<gem_name>','<gem_version>'
and anytime you want to install all the dependencies on a new machine you just run bundle install and it installs the dependencies into the new machine.
I want to do something similar in meteor. example: I have a meteor project that takes the karma and angular-meteor packages (as well as a couple private packages in a bitbucket repo).
so in a gemfile, it would look something like this
source 'http://<atmosphere_url>'
package 'uringo:angular','0.8.8'
package 'sanjo:karma','1.5.1'
source 'https://<my_bit_bucket_repo'>'
package 'name:package1','0.0.1'
package 'name:package2','0.0.1'
and then I just need the command to run the package manager to install the different packages.
It looks like I have to keep packages with the code. So in the top level directory, there's the package folder and all my internal packages for the project will need to live there. Then I just modify the .meteor/project file to include which packages I want in that build. Then when I launch meteor then even though there are many packages in my /packages folder, only the packages in the .meteor/project file will be included.
In addition to the packages in the official Meteor release being used by your app, meteor list and meteor add also search the packages directory at the top of your app. You can also use the packages directory to break your app into subpackages for your convenience, or to test packages that you might want to publish. See Writing Packages. -- http://docs.meteor.com/#/full/usingpackages
so this means just because the package is included in the /packages directory within the project, doesn't mean the project is actually 'using' the package.

R install package globally

How do I install an R package globally, so it's available to all users? Currently I'm doing
R.exe CMD INSTALL *.zip
But it does
* installing to library 'C:/Users/Matt/Documents/R/win-library/2.15'
I would like to install the packages alongside R in Windows' 'program files'.
Your big problem here is installing to C:\Program Files\. This means on versions of windows with file permissions, you need admin permissions to write to that folder. As R does not commonly request admin permissions, it will on default install to an user subdirectory, unless you run R as administrator (by right clicking on the shortcut). In which case you can use the GUI to install packages and it will install them globally by default. For working on the command line, you can also run the cmd session as administrator.
In future, it's recommended that you install R to say, C:\R\ to avoid this.
What worked for me was running:
install.packages("MyPackage", lib="C:\\Program Files\\R\\R-3.0.1\\library")
Installing it to Program Files wasn't a problem for me - the problem was that the default installation directory was in C:\\Users\\Mike\\Documents\\R\\...
Ultimately you just want to install it to wherever .libPaths() looks by default, and in my environment that was most commonly C:\\Program Files\\R\\R-3.0.1\\library
Here is a way to specify where to find or install libraries. You can put the libraries in a common directory.
http://cran.r-project.org/doc/manuals/R-admin.html#Managing-libraries

my RPM package requires 2 already installed shared libraries

I'm looking for help about making rpm packages.
I just created my first RPM package with rpmbuild.
This package is simple. It has just to copy several config files and one executable.
I cannot install this .rpm because 2 shared librairies used by the executable are required.
These librairies are already installed but they are not linked with another .rpm package because I build them from one of my projects. There are located in the /usr/myproject/lib directory.
I tried to put symbolic links to /lib and /usr/lib, tried also to run a "ldconfig" update from a .conf file which contains the /usr/myproject/lib directory, and tried to update the LD_LIBRARY_PATH env variable without any success.
I know I can ignore dependencies using the -nodeps command line option but I'd like in the next step to create my own yum repository but yum do not allow to install a package if the dependencies are not fulfilled.
I would also prefer to keep the automatic dependency feature of rpmbuild enabled.
Thanks in advance.
Package these 2 libraries in another RPM, then you can install both RPMs in one rpm -i call.

Resources