Skip to content

Cannot build updater tool. #4

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
JordanMartinez opened this issue Aug 27, 2020 · 5 comments · Fixed by #7
Closed

Cannot build updater tool. #4

JordanMartinez opened this issue Aug 27, 2020 · 5 comments · Fixed by #7
Labels
type: documentation Improvements or additions to documentation.

Comments

@JordanMartinez
Copy link
Contributor

While following the instructions for compiling the updater tool, I got stuck here:

  1. Ran nix-shell
  2. Ran npm run build
  3. Got this error: sh: ncc: command not found:
[nix-shell:~/Programming/Git Projects/purescript-contrib-governance/updater]$ npm run build

> contrib-updater@ build /home/jordan/Programming/Git Projects/purescript-contrib-governance/updater
> spago bundle-module --to output/index.js && ncc build --minify --out bin index.js

[info] Installation complete.
           Src   Lib   All
Warnings   0     0     0  
Errors     0     0     0  
[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
sh: ncc: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! contrib-updater@ build: `spago bundle-module --to output/index.js && ncc build --minify --out bin index.js`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the contrib-updater@ build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/jordan/.npm/_logs/2020-08-27T20_42_15_055Z-debug.log
@thomashoneyman
Copy link
Contributor

Good catch. The shell provides everything except the NPM dependencies — ncc, specifically, which might actually be in Nix and I haven’t checked — so you also need to run npm install.

@thomashoneyman thomashoneyman added the type: documentation Improvements or additions to documentation. label Aug 27, 2020
@JordanMartinez
Copy link
Contributor Author

Ok. Another issue to fix. I get an error when I run sudo npm link:

[nix-shell:~/Programming/Git Projects/purescript-contrib-governance/updater]$ sudo npm link
sudo npm link
sudo: npm: command not found

Turns out you have to exit nix-shell and then run npm link

@thomashoneyman
Copy link
Contributor

thomashoneyman commented Aug 28, 2020

Huh — that’s weird. I’m not exiting the shell and Node is included in the shell, which should also include npm automatically. You don’t have access to npm at all in the shell?

@thomashoneyman
Copy link
Contributor

Reproduction from my system:

~/Desktop/governance/updater (main) $ which node
/.../.nvm/versions/node/v12.0.0/bin/node

~/Desktop/governance/updater (main) $ which npm
/.../.nvm/versions/node/v12.0.0/bin/npm

~/Desktop/governance/updater (main) $ nix-shell

[nix-shell:~/.../governance/updater]$ which node
/nix/store/0j4i6dsqq4fvvm7z5zka62vi3xrfgzv6-nodejs-12.15.0/bin/node

[nix-shell:~/.../governance/updater]$ which npm
/nix/store/0j4i6dsqq4fvvm7z5zka62vi3xrfgzv6-nodejs-12.15.0/bin/npm

However, it's also acceptable to just run npm link outside the shell.

@JordanMartinez
Copy link
Contributor Author

The issue arises when I use both sudo and npm in the same command. Running npm link causes a crash due to permissions issues, which made me run sudo npm link. However, running that will then output the above error as though npm doesn't exist when it clearly does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation Improvements or additions to documentation.
Development

Successfully merging a pull request may close this issue.

2 participants