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

[Bug]: yarn install:server does not work #4377

Closed
1 task done
pogman-code opened this issue Feb 14, 2025 · 3 comments
Closed
1 task done

[Bug]: yarn install:server does not work #4377

pogman-code opened this issue Feb 14, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@pogman-code
Copy link

Verified issue does not already exist?

  • I have searched and found no existing issue

What happened?

The new script yarn install:server does not work out of the box but yarn workspaces focus actual-sync --production does.

As per the documentation (https://actualbudget.org/docs/install/local#installing-actual) it seems that it should work.
I tried with several version of node/npm with the same result, above example uses v18.16.0 as specified in .nvmrc

I looked a bit online but most answer suggest to run yarn install first, that kind of lose the purpose of yarn install:server that is supposed to perform a "light" install, right?

How can we reproduce the issue?

user@localhost ~ $ git clone https://github.com/actualbudget/actual.git               
Cloning into 'actual'...
remote: Enumerating objects: 55157, done.
remote: Counting objects: 100% (402/402), done.
remote: Compressing objects: 100% (276/276), done.
remote: Total 55157 (delta 243), reused 130 (delta 126), pack-reused 54755 (from 3)
Receiving objects: 100% (55157/55157), 210.86 MiB | 40.61 MiB/s, done.
Resolving deltas: 100% (39757/39757), done.



user@localhost ~ $ cd actual 
Found '/home/user/actual/.nvmrc' with version <v18.16.0>
Downloading and installing node v18.16.0...
Downloading https://nodejs.org/dist/v18.16.0/node-v18.16.0-linux-x64.tar.xz...
######################################################################################################################################################################################################################################################################################################################## 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v18.16.0 (npm v9.5.1)



user@localhost actual (master v23.1.12+) $ yarn install:server         
Usage Error: Couldn't find the node_modules state file - running an install might help (findPackageLocation)

$ yarn run [--inspect] [--inspect-brk] [-T,--top-level] [-B,--binaries-only] [--require #0] <scriptName> ...



user@localhost actual (master v23.1.12+) $ yarn workspaces focus actual-sync --production
➤ YN0000: · Yarn 4.3.1
➤ YN0000: ┌ Resolution step
➤ YN0085: │ - 7zip-bin@npm:5.2.0, @aashutoshrathi/word-wrap@npm:1.2.6, @ampproject/remapping@npm:2.2.1, @antfu/utils@npm:0.7.10, @apideck/better-ajv-errors@npm:0.3.6, @babel/code-frame@npm:7.24.7, @babel/code-frame@npm:7.26.2, @babel/compat-data@npm:7.23.5, @babel/compat-data@npm:7.26.5, and 1911 more.
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0013: │ 277 packages were added to the project (+ 18.54 MiB).
➤ YN0000: └ Completed in 2s 170ms
➤ YN0000: ┌ Link step
➤ YN0007: │ bcrypt@npm:5.1.1 must be built because it never has been before or the last one failed
➤ YN0007: │ better-sqlite3@npm:11.7.0 must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 1s 692ms
➤ YN0000: · Done in 3s 951ms

Where are you hosting Actual?

Locally via Yarn

What browsers are you seeing the problem on?

Other

Operating System

Linux

@pogman-code pogman-code added the bug Something isn't working label Feb 14, 2025
@MikesGlitch
Copy link
Contributor

MikesGlitch commented Feb 15, 2025

Thanks for raising. Looks like an annoying yarn issue - it doesn't let you run scripts unless you've done an install 🤦‍♂ . Funnily enough, npm seems to work:

npm run install:server

I'll have a look. We may have to remove the script.

@pogman-code
Copy link
Author

I have seen some discussions about this being an issue with recent versions of yarn.

I guess as long as we can run yarn workspaces focus actual-sync --production, that OK 🤷

MikesGlitch added a commit to actualbudget/docs that referenced this issue Feb 17, 2025
Issue reported here: actualbudget/actual#4377

https://deploy-preview-645.www.actualbudget.org/docs/install/local

It turns out that yarn doesn't let you run scripts without first
installing dependencies, so users will have to type it in the install
manually.

The other alternative is to run the script with npm but that would add
confusion.

I think yarn workspace focus is the best option to pick but here was the
options:

- Instruct users to ```yarn install``` (which would install all deps) -
1.07GB
- Instruct users to ```yarn workspaces focus @actual-app/sync-server
--production``` (which is a long command) - 60.6MB
- Create a new shell script to run the command ```
./install-server.sh```

In future we might want to consider packaging the server up into an
executable. That way the user wont have to install node/deal with any of
this stuff.

Here's an example packager - i've never used it:
https://github.com/nexe/nexe
@MikesGlitch
Copy link
Contributor

Have updated the docs: actualbudget/docs#645

The change is to run the command without the script for now. Closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants