Skip to content

index.js vs updater.js #8

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

Closed
milesfrain opened this issue Aug 31, 2020 · 6 comments
Closed

index.js vs updater.js #8

milesfrain opened this issue Aug 31, 2020 · 6 comments

Comments

@milesfrain
Copy link
Member

Finally getting around to trying this out, but am encountering an error when following the updater instructions.

nix-shell
...
error: getting attributes of path '/home/miles/projects/purescript/governance/updater/bin/index.js': No such file or directory

Wondering if bin/updater.js should be renamed to bin/index.js or if some mentions of bin/index.js should be replaced with bin/updater.js.

@thomashoneyman
Copy link
Contributor

Do you have this commit locally?
887a28c

If not, can you pull main? The issue is that if you have never built the project then the Nix expression tries to locate a file which does not yet exist -- the very file the Nix shell produces as part of starting up.

@milesfrain
Copy link
Member Author

Yes, I have that commit.

if you have never built the project

Does this mean I need to run spago build or spago bundle-app first, or should that be handled by nix-shell?

Do the instructions work for you on a fresh clone?

@thomashoneyman
Copy link
Contributor

thomashoneyman commented Aug 31, 2020

I had forgotten an entry in the Nix shell still triggering the issue. I've removed it in fd2fb5d and a fresh clone works on my system.

Edit: no, still not quite working correctly. What a nightmare. I ended up just updating the README installation instructions.

d45f41c

@milesfrain
Copy link
Member Author

With latest changes:

➜  updater git:(main) git log --oneline
ae2e017 (HEAD -> main, origin/main, origin/HEAD) Update package.json
29e5262 Update package.json
d45f41c Update installation instructions
fd2fb5d Remove unnecessary executable line.
887a28c Update shell.nix
dbe5e44 Allow full installation via the Nix shell. (#7)
4bf6a40 Include bower_components in .gitignore template (#6)
➜  updater git:(main) nix-shell        
audited 2 packages in 0.331s
found 0 vulnerabilities

> contrib-updater@ build /home/miles/projects/purescript/governance/updater
> spago bundle-module --to output/index.js && ncc build --minify --out bin index.js

[info] Installation complete.
[info] Build succeeded.
[info] Bundling first...
[info] Bundle succeeded and output file to output/index.js
[info] Make module succeeded and output file to output/index.js
ncc: Version 0.23.0
ncc: Compiling file index.js
305kB  bin/index.js
305kB  [2215ms] - ncc 0.23.0

[nix-shell:~/projects/purescript/governance/updater]$ alias contrib-updater='node ~/path/to/governance/updater/bin/index.js'

[nix-shell:~/projects/purescript/governance/updater]$ contrib-updater --help
internal/modules/cjs/loader.js:796
    throw err;
    ^

Error: Cannot find module '/home/miles/path/to/governance/updater/bin/index.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:793:17)
    at Function.Module._load (internal/modules/cjs/loader.js:686:27)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10)
    at internal/main/run_main_module.js:17:11 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

@thomashoneyman
Copy link
Contributor

thomashoneyman commented Sep 1, 2020

Sorry, perhaps these docs are badly written. You'd need to replace /path/to/governance with, for example, ~/miles/governance/updater/bin/index.js or wherever you've checked out this repository.

@thomashoneyman
Copy link
Contributor

Addressed by #9, #7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants