Skip to content

ActionHero cannot be installed globally #1141

Description

@evantahler

If you install actionhero globally npm install -g actionhero you can generate projects and run some of the CLI commands. However, you no longer can run the server (npm start).

“actionhero” (the globally installed binary) has created the API object form /global/actionhero/index.js and has loaded all the initializers and added them there. But then when you hit a file in your local project, it does require('actionhero') In that local file, it loads /project/node_modules/actionhero/index.js, and that file’s .api = {}. (edited)

I think the solution is in every class file rather than a simple require(../index.js) we actually need to check the folder structure of the local environment (project_root) and load from there rather than just the relative index.js

  • ActionHero Version: 18.x.x
  • Node.js Version: all
  • Operating System: all

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions