Backpack Permissionmanager not getting install - permissions

I am using Laravel Backpack and trying to setup roles and permissions in it.
Command I am using is:
composer require backpack/permissionmanager
It is throwing this error again and again:
Can anyone know why is it so? What else I could do to get it installed?

It looks like your problem is NOT installing backpack/permissionmanager, but in installing backpack/devtools. That is a private package, where you only have access to the dist, not the source.
In short, using Composer you can install things:
(A) from dist - will unzip the package to your vendor directory;
(B) from source - will git clone the package to your vendor directory;
It looks like you're trying to do a git clone for backpack/devtools, but since you do not have access the source, you can't do that.
If you've run the composer command using the --prefer-source flag, don't. Otherwise, check your composer.json file for any mentions of this preference. You should make sure you're downloading from dist, not source.

Related

Need to check where reposync is saving the .rpm files

I am working in a yum repository that is for RHEL6 (This is our copy of the RHEL6 yum repo).
I need to do reposync so that this server can get the latest version of all the packages.
I need to know in which all the rpm packages are getting saved.
Like is there any file that can let me know whenever I am running reposync where the .rpm files are saved?
In short, I want to know, how can I know the name and location of all repositories that my server is hosting. And where the repo files are getting saved.
I have tried looking for the solution on StackOverflow and other sites. I am getting information on how to create a new repo but I couldn't find the answer that I want.

How to get the version of a remote npm package using a bin script

I'm trying to set up an npx script to create a template project.
In package.json I have:
"bin": {
"init": "bin/init"
}
In the init script I'm using tag='v'$(npm pkg get version | tr -d '"') to get the version of the package. I then use git clone --depth 1 --branch $tag https://github.com/matriarx/typescript.git to clone that specific repository for that specific tag.
When I do yarn link and try use it locally, from within that specific project, it works because it's able to correctly pick up the package.json version. So the above only works if it's run inside an existing project. However that's not what I want to do.
I want to enable someone to run it even if they have nothing locally, by simply doing npx #matriarx/typescript init and it should create the new project by cloning it. More than that I want them to be able to clone any specific version by using npx #matriarx/typescript#0.0.1 init in order to clone a specific version.
However it seems that anything I try is only able to get the version from a local package.json that already exists.
I could just clone the current existing repository without specifying any tag, but that would defeat the point of having releases, then it would just clone any current code completely disregarding the release. So it has to clone the tagged release.
How can I get the remote package version stored on npm from the bin script without having anything locally before hand?
Alternatively is there a better way to do what I'm trying to do?
EDIT: I ended up just hardcoding the version in the script, which works but it sucks because it's tedious to have to update it every time I bump the version. Though for now I still don't know a better way to do it.
After some more time messing around I figured out there is a standard way of doing it, at least since npm 7.
If you have a project like example then you can create a completely separate project called create-example with a bin script.
When you use npm init example, npm will automatically search for a package prefixed with "create-" and execute its main bin script. So when running npm init example it will search for that create-example package and execute the bin script, which will install the example package.
This is how most of the bigger packages like react and next do it.
This approach comes with some disadvantages that I really don't like, for example it will show the incorrect dependencies on npm and it will cause you to have to maintain multiple projects and semvers on different projects. However it will also allow you to create a clean separation between the actual project and the installation of that project.
For some projects it might also make a lot more sense. For example if you have a project that doesn't have a package.json at all and you want to create a setup for it, it wouldn't make sense to create an npm package inside that project just for that. Instead you can create a separate "create-project" package just to set it up and keep npm out of the actual project. In other words it gives you a neat way to create bin scripts for a completely separate project that doesn't have anything to do with npm.
You could also just have created a normal shell script and execute it using curl but I guess npm just gives you another way to do it.
You still have to hardcode the version in that "create-project" package, I still have not seen a way to automatically determine the version from a remote package. The only way I've managed to do that is to completely download the package, get the version, then delete it, but that would be terrible for people with a slower internet connection or limited data.

How can I download the source code of Artifactory NPM modules?

I need the source code of the NPM modules inside the artifactory installation #jfrog folder artifactory-oss-7.7.3/app/frontend/bin/server/dist/node_modules/#jfrog. Checking the package.json files I see the following
,"_resolved": "https://entplus.jfrog.io/artifactory/api/npm/npm-virtual/#jfrog/nodejs-commons/-/#jfrog/nodejs-commons-2.0.2.tgz"
However, when I try to follow the link I get a Forbidden error. I also see references to a git repository:
git.jfrog.info/~odedb/jfrog-artifactory-nodejs-client.git
However, I get a timeout error for accessing. Any clue on how to download these files?
The latest version of Artifactory OSS source code can be downloaded from https://jfrog.com/open-source/.
The direct download link: https://releases.jfrog.io/artifactory/bintray-artifactory/org/artifactory/oss/jfrog-artifactory-oss/[RELEASE]/jfrog-artifactory-oss-[RELEASE]-linux.tar.gz
[RELEASE] is replaced automatically to latest, if you need specific version, pls replace with version number.

No detect the external library (Phpoffice) in yii2

Two computers are working on the SAME repository but first computer detect the library and work well but second computer not detect it and show "Error 'PhpOffice\Phpspreadsheet\Reader\Xlsx' not found".
In vendor, the library also exist.
composer.json and composer.lock also the same on both computer.
One thing is that by git ignore, I use yii's composer mechanism at 1st computer but at sec computer(err computer), I add library manually.
If you want to use a composer package, you absolutely need to install it using composer. This ensures that the autoloader is generated properly and your class can be found through PHP.
Copying library files into vendor directory is not enough to install it. During installation Composer creates autoload script with information how to find all classes installed by Composer. If you just copy library files, Composer will not even know that it exist and will not able load any class from it.
If you cannot use Composer on server/computer A, you should install all dependencies on different computer (B) and copy the entire vendor directory into server/computer A. Autoload definitions are in vendor so it should work if you copy the whole dorectory.

how to install a package in golang

I try to connect to SQL server in golang, I searched in internet and through this address: https://github.com/denisenkom/go-mssqldb I understood that first I need to install a package for the purpose, but when I want to install this package through git terminal by entering this command:
$ go get github.com/denisenkom/go-mssqldb
I receive this error :
can't load package: package github.com/denisenkom/go-mssqldb: no buildable go source files in C:\Go\src\github.com\dnisenkom\go-mssqldb
my $GOPATH is already set.I don't know how to fix this problem ...
According to the golang website:
Get downloads and installs the packages named by the import paths, along with their dependencies.
It sounds like the download isn't working, which is causing the folder to be empty. One alternative is to download the driver as a zip file and run go install on the folder.