Cli: Fixes #10992: Disable deprecation warning when running Joplin from CLI #11074
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #10992
Summary
The change is to add a flag to the shebang line that should hide all warning when the
main.js
file is run directly (aka$: ./main.js
), but it shouldn't affect when running in dev mode (yarn start
).I took more time to fix this than it was probably necessary because at first I was testing the modification running
node ./build/main.js version
which ignored the shebang line.The depreciation warning started to appear when running the CLI with Node.js version >21 where
punycode
std lib is being deprecated but it is still used by a lot of our dependencies.Testing
packages/app-cli
yarn build
./build/main.js version
Dev environment should still print the warning:
yarn start version
onpackages/app-cli