wa-automate-nodejs
wa-automate-nodejs copied to clipboard
--config when run npx doesn't work
Are you using the latest version of the library?
- [X] I have checked and am using the latest version of the library.
What type of session are you experiencing this issue on?
Multi-device and I have set multiDevice to true in my config OR am using the --multi-device flag
What type of host account are you experiencing this issue on?
Business account
Mode
EASY API/CLI
Current Behavior
Got a message: "unable to read config file json: (...).config.json"
Expected Behavior
Accept and load config variables
Steps To Reproduce
Run: npx @open-wa/wa-automate --config (...).config.json Receive: Unable to read config file json: (...).config.json
create() code OR full CLI command + CONFIG
No response
DEBUG INFO
{
"WA_VERSION": "2.2232.8",
"WA_AUTOMATE_VERSION": "4.46.0",
"BROWSER_VERSION": "HeadlessChrome/103.0.5058.0",
"START_TS": 1662388888020,
"RAM_INFO": "Total: 2.03 GB | Free: 1.42 GB",
"PPTR_VERSION": "15.0.0",
"LATEST_VERSION": true,
"CLI": true
}
Environment
- OS: Linux 5.15
- Node: 17.9.0
- npm: 8.10.0
Screenshots/Logs
No response
Anything else?
No response
Adding --verbose result:
info: Set up logging for console {"timestamp":"2022-09-05T15:01:30.067Z"} info: Config /dados/(...).config.json is directory: false {"timestamp":"2022-09-05T15:01:30.070Z"} info: Checking exists: /dados/(...).config.json {"timestamp":"2022-09-05T15:01:30.071Z"} info: Attempting to open: /dados/(...).config.json {"timestamp":"2022-09-05T15:01:30.071Z"} info: /dados/(...).config.json is valid {"timestamp":"2022-09-05T15:01:30.073Z"} Unable to read config file json: /dados/(...).config.json info: Using config file: ??? {"timestamp":"2022-09-05T15:01:30.074Z"}
@silvaartur what's the cli command you're using?
npx @open-wa/wa-automate --config (...).config.json
@smashah I found the problem. I set --config as absolute path on past versions... doesn't work this way on currently version.
Using /getConfig discovered my config.json is not loaded completed... like licensekey value for example.
@silvaartur Please add the whole path as you set it:
npx @open-wa/wa-automate --config (...).config.json
it's best to just change sensitive info instead of redact it completely along with other text
Happen on >= 4.44.4
Running:
npx --yes @open-wa/wa-automate --config /data/1999123456.config.json --pm2 "--max-memory-restart 1G --name 1999123456"
or
npx --yes @open-wa/wa-automate --config 1999123456.config.json --pm2 "--max-memory-restart 1G --name 1999123456"
or
npx --yes @open-wa/wa-automate --config ./1999123456.config.json --pm2 "--max-memory-restart 1G --name 1999123456"
Facing this issue too .
currently experiencing this issue too
smh this was literally a one word fix. Just needed to await
a promise. Thanks for your patience
@github-actions run
⚡ Release! ⚡
(async () => {
function exec(cmd) {
console.log(execSync(cmd).toString());
}
//set the version type
process.env.VERS = "patch"
// Config
const gitUserEmail = "github-actions[bot]@users.noreply.github.com";
const gitUserName = "github-actions[bot]";
exec(`echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc`);
exec(`git config --global user.email "${gitUserEmail}"`);
exec(`git config --global user.name "${gitUserName}"`);
exec(`npm i -D`);
exec(`npm run release-ci $VERS`);
// types only package
exec('npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN')
exec(`cd ./types-only && npm version $VERS && npm run build && npm publish && cd ..`);
exec(`git commit -a -m 'updated types-only package'`);
exec(`git push --force`);
//comment on the issue
var result = execSync(`npx auto-changelog -o ./tempchangelog.txt --commit-limit false --template ./compact-keepachangelog.hbs --stdout`).toString();
await postComment(result);
//create changelog image
exec(`npm run release-image`);
exec(`git commit -a -m 'updated release-image'`);
exec(`git push --force`);
})();