Failed to pack project (Agents)

Hi everyone,

Context:
I have tried to set up agents.
I installed the extension and used the ‘initialize project…’ command. Then i connected to my OpenFlow, by selecting protocol: https and then providing the link to my OpenFlow.
I then logged in by pressing enter twice, and it linked to my OpenFlow and created an agent that I could see in the Agent tab in OpenFlow.
This all seemed to work with no issues.

Issue:
However, when I try to run the ‘Pack and publish…’-command I get this error:

c:\Users\sgj\Deploy\pythonProjects\AgentDemo\AgentDemo-0.0.7.tgz + " does not exist

I notice that this part of the error message:
c:\Users\sgj\Deploy\pythonProjects\AgentDemo
is the path to the project folder:

While this part:
AgentDemo
corresponds to the name variable set in the package.json.

The full package.json code is here:

{
    "name": "AgentDemo",
    "version": "0.0.7",
    "description": "Example agent, please change",
    "main": "main.py",
    "openiap": {
        "daemon": false,
        "chromium": false,
        "language": "python"
    }
}

This is my first time trying agents, so unfortunately I am not sure what is causing this or if I am doing it incorrectly. If anyone has any tips or solutions feel free to reply :slight_smile:

Yeah, there is a bug when initializing a project on windows. You need to remove the “path” from name. Then it should work.

Or just delete project.json and type npm init -y in the folder, to create a new one, then re-initilize using the openiap plugin.

Hi again,

I tried deleting the path from the name.
I assume you mean leaving the name be an empty string like this (only a snippet of the package.json):

{
    "name": "",
    "version": "1.0.4",
    "main": "main.py"
}

However I still get the error. Now it only says the folder path (and nothing more) in the error message:

Failed to pack project, c:\Users\sgj\Deploy\pythonProjects\AgentDemo\-1.0.4.tgz + " does not exist 

I also tried to delete the package.json file and run

npm init -y

And then running the:

Initialize project, ensure package.json and launch.json exists for openiap instance

command in VSCode.
I then get this package.json file:

 {
    "name": "agentdemo",
    "version": "1.0.4",
    "main": "main.py",
    "scripts": {
        "test": "echo \"Error: no test specified\" && exit 1"
    },
    "keywords": [],
    "author": "",
    "license": "ISC",
    "description": "",
    "openiap": {
        "language": "python",
        "daemon": false,
        "chromium": false
    }
}

Where I have changed the “main” from node.js to main.py

However, I still get the same error when trying to run the publish package command. (As above I have also tried this approach and the leaving the “name” empty.)

Am I not doing the fixes correctly or is there a another issue?

Also, thank you very much for your quick response :slight_smile:

No it needs a name, but you need to avoid special charecters in the name.
I found it super puzzling you get file not found.

What happens when you run npm pack your self, does it create the file?
And if that works, can you then publish ?
If you can pack, but not publish, you can also upload the file in the openflow UI. ( agents → packages → add oackage )

I found out that I had not installed NodeJS properly.

When I installed it properly (after your suggestions to use npm pack) it worked. Both using npm pack but also using the pack and publish command in VSCode.

Thank you very much for the quick help. It is very appreciated.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.