Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Desktop: Dev branch not working with node 16 #10234

Closed
AliceHincu opened this issue Mar 30, 2024 · 3 comments
Closed

Desktop: Dev branch not working with node 16 #10234

AliceHincu opened this issue Mar 30, 2024 · 3 comments
Labels
bug It's a bug

Comments

@AliceHincu
Copy link
Contributor

Operating system

Windows

Joplin version

last version from dev branch

Desktop version info

No response

Current behaviour

Steps to reproduce:

  • Before installing Node, I deleted everything related to nvm, node, yarn, and npm. This means uninstalling Node from Control Panel and deleting everything related to them inside %APPDATA% (including caching)
  • I installed Node 16.20.2 from here
  • I followed the steps from your BUILD.md (I did not open Visual Studio Code at all since, every command was ran with Windows Powershell as Administrator )
  • After running yarn install, this was the output:
➤ YN0008: │ husky@patch:husky@npm%3A3.1.0#./.yarn/patches/husky-npm-3.1.0-5cc13e4e34.patch::version=3.1.0&hash=d9603f&locator=root%40workspace%3A. must be rebuilt because its dependency tree changed
➤ YN0008: │ keytar@npm:7.9.0 must be rebuilt because its dependency tree changed
➤ YN0008: │ sharp@npm:0.33.2 must be rebuilt because its dependency tree changed
➤ YN0008: │ sqlite3@npm:5.1.6 [ea905] must be rebuilt because its dependency tree changed
➤ YN0008: │ canvas@npm:2.11.2 must be rebuilt because its dependency tree changed
➤ YN0008: │ tesseract.js@npm:5.0.4 must be rebuilt because its dependency tree changed
➤ YN0008: │ core-js@npm:3.33.1 must be rebuilt because its dependency tree changed
➤ YN0008: │ core-js-pure@npm:3.33.1 must be rebuilt because its dependency tree changed
➤ YN0008: │ @fortawesome/fontawesome-free@npm:5.15.4 must be rebuilt because its dependency tree changed
➤ YN0008: │ electron@npm:29.1.0 must be rebuilt because its dependency tree changed
➤ YN0008: │ @fortawesome/fontawesome-common-types@npm:0.2.36 must be rebuilt because its dependency tree changed
➤ YN0008: │ @fortawesome/fontawesome-common-types@npm:6.4.2 must be rebuilt because its dependency tree changed
➤ YN0008: │ @fortawesome/fontawesome-common-types@npm:6.1.2 must be rebuilt because its dependency tree changed
➤ YN0007: │ root@workspace:. must be built because it never has been before or the last one failed
➤ YN0008: │ @joplin/app-mobile@workspace:packages/app-mobile must be rebuilt because its dependency tree changed
➤ YN0008: │ @fortawesome/fontawesome-svg-core@npm:1.2.36 must be rebuilt because its dependency tree changed
➤ YN0008: │ @fortawesome/free-regular-svg-icons@npm:5.15.4 must be rebuilt because its dependency tree changed
➤ YN0008: │ @fortawesome/free-solid-svg-icons@npm:5.15.4 must be rebuilt because its dependency tree changed
➤ YN0008: │ @fortawesome/fontawesome-svg-core@npm:6.4.2 must be rebuilt because its dependency tree changed
➤ YN0008: │ @fortawesome/free-brands-svg-icons@npm:6.4.2 must be rebuilt because its dependency tree changed
➤ YN0008: │ @fortawesome/free-regular-svg-icons@npm:6.4.2 must be rebuilt because its dependency tree changed
➤ YN0008: │ @fortawesome/free-solid-svg-icons@npm:6.4.2 must be rebuilt because its dependency tree changed
➤ YN0008: │ @fortawesome/fontawesome-svg-core@npm:6.1.2 must be rebuilt because its dependency tree changed
➤ YN0008: │ @fortawesome/free-solid-svg-icons@npm:6.1.2 must be rebuilt because its dependency tree changed
➤ YN0009: │ root@workspace:. couldn't be built successfully (exit code 1, logs can be found here: <path_to_build_log>\build.log)

The last line that starts with root@workspace is problematic. I also attached the logs, and there you can find the following errors:

➤ YN0000: [@joplin/app-desktop]: Error: Cannot find module 'readline/promises'
[�[90m00:53:17�[39m] Error: Command failed with exit code 1: yarn run buildParallel

Expected behaviour

Regarding the first error: I searched on the Node website, Readline section, the correct syntax:

  • the correct syntax for Node 16 is this one
  • the correct syntax for Node 17 and above is this one

Fix:

  • Either update the documentation here from version 16 to 17
  • Or change inside joplin>packages>default-plugins>utils>waitForCliInput.ts the first line from const readline = require('readline/promises'); to const readline = require('readline');

After this change, I was able to start the application. The second error was because of @joplin/lib, but I do not know the solution.

Logs

error node 16.txt

@AliceHincu AliceHincu added the bug It's a bug label Mar 30, 2024
@AliceHincu
Copy link
Contributor Author

Also, I saw on the internet( 1, 2, 3 ) a lot of people having similar errors (including me) like these:

Error: EPERM: operation not permitted, unlink 'C:\joplin\node_modules\@babel\code-frame\lib\index.js'
Internal Error: EPERM: operation not permitted, open ...

Nothing from the internet worked. It didn't allow me to run the commands for clearing the cache because of this error . I ran everything as an administrator, I didn't have anything Node-related opened, I tried multiple versions of Node using nvm, etc..

After I ran npm list -g --depth 0 , I saw I had multiple versions. I did the steps that I mentioned in the beginning:

  • I uninstalled everything related to nvm, node, yarn, and npm
  • I cleared the cache from AppData (Local + Roaming) - meaning I deleted the folders manually
  • I deleted and cloned the repository again (but I think deleting the file yarn.lock should be enough)
  • I installed node without nvm (and I added it to the PATH) and ran the commands with Windows PowerShell (not VSC terminal), and it worked.

So, I made sure to have a fresh start before cloning and working on this project. I think there can be some issues with multiple versions of npm/yarn (since I also had installed yarn through npm before). Maybe this helps someone in the future.

@laurent22
Copy link
Owner

Yes I think we need more than Node 16 by now, and the doc and other places should be updated. I use Node v19.6.1. Could you check if it's working with that version?

@AliceHincu
Copy link
Contributor Author

I followed the same steps for clearing everything Node-related (I forgot to mention but in Program Files the folder "nodejs" should also be deleted since I had problems with it)

I installed Node 19.9.0 and after running yarn install, I can confirm that the desktop version worked with no problems, without having to modify anything. So the problem is with Node 16.20.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It's a bug
Projects
None yet
Development

No branches or pull requests

2 participants