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
If you install actionhero globally
npm install -g actionheroyou 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.jsand has loaded all the initializers and added them there. But then when you hit a file in your local project, it doesrequire('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.js18.x.x