Southclaws / sampctl

The Swiss Army Knife of SA:MP - vital tools for any server owner or library maintainer.
GNU General Public License v3.0
242 stars 33 forks source link

failed to interpret directory as Pawn package #380

Closed MassonNN closed 4 years ago

MassonNN commented 4 years ago

When I send:

sampctl package ensure

or

sampctl package install

The terminal sends me:

ERROR: failed to interpret directory as Pawn package: failed to read package definition: no package definition file (pawn.{json|yaml|toml})

Full code:

E:\Code\Server>sampctl package ensure
ERROR: failed to interpret directory as Pawn package: failed to read package definition: no package definition file (pawn.{json|yaml|toml})
Southclaws commented 4 years ago

Check the permissions of your pawn.json file. It seems sampctl can't read it for some reason.

MassonNN commented 4 years ago

I am trying to do this on a local computer. All permissions are set. I tried reinstalling sampctl and it didn't help. I am trying to update the libraries, but I see an error in pawn.json, although such a file is located in the libraries themselves

ADRFranklin commented 4 years ago

ERROR: failed to interpret directory as Pawn package: failed to read package definition: no package definition file (pawn.{json|yaml|toml})

This simply means in whatever directory you are currently running sampctl in, it simply could not find a configuration file (pawn) with the extension of json, yaml or toml.

Please make sure you are in the correct folder as the configuration file, please also make sure you actually have a configuration file and if you don't, then use sampctl package init.

Their should never be any issue with permissions for the configuration file, as it is created with pretty open permissions. I also noticed you mention libraries, if these libraries are remote packages, then you shouldn't be touching the files for them at all, Since the next time you run sampctl package ensure or sampctl package run it will overwrite any changes to those files with the exact files stored in your .samp folder.

MassonNN commented 4 years ago

Well. I tried to install the package on my server using sampctl. Before that I installed sampctl on my server following the guide

root@server:/home/server# sampctl package install Southclaws/pawn-uuid
ERROR: failed to interpret directory as Pawn package: failed to read package definition: no package definition file (pawn.{json|yaml|toml})

I didn't touch anything else

ADRFranklin commented 4 years ago

Can you verify that you have a configuration file inside /home/server? There should be a file called pawn with with the extension of either json, yaml.

If you don't have a file (which I suspect you don't), then you need to create one using sampctl package init. When ever you start a new sampctl project, you must initialise the configuration file. Without it, sampctl does not know what dependencies you want or need.

ADRFranklin commented 4 years ago

Something else I just noticed is that in your original message, you stated that E:\Code\Server was your path to your server. Yet in the last response you made, you seem to have it as /home/server. I can see that one is local (Windows) and the other is a remote/production deployment of sampctl (Linux).

I would make sure you have a configuration file that matches your local one on your remote server.

MassonNN commented 4 years ago

Fixed this problem by sampctl package init in my samp server directory. Thanks)))