-
Notifications
You must be signed in to change notification settings - Fork 131
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
spago installed via npm does not seem to fully install #192
Comments
Thanks for the report @bbarker! Some notes:
$ docker-bash node:12
root@71c1f9e95b14:/# npm install -g spago
> [email protected] preinstall /usr/local/lib/node_modules/spago
> node ./install.js
/usr/local/bin/spago -> /usr/local/lib/node_modules/spago/spago.exe
+ [email protected]
added 29 packages from 19 contributors in 4.809s
root@71c1f9e95b14:/# spago -v
This is a stub that will be replaced on install. It is needed to workaround https://github.com/yarnpkg/yarn/issues/3421
root@71c1f9e95b14:/# |
Found it. TL;DR: you need to use So running this command in the container works correctly: I feel this "installing npm packages as root" might be a common problem, so we should definitely add to the FAQ something along the lines of "DON'T RUN NPM AS ROOT" |
I don't know the full context of this issue (so my apologies if this isn't
helpful), but isn't this a symptom of not configuring the npm prefix to a
directory that doesn't require root privileges? Otherwise, one has to run
node with root privileges to get anything to work.
… |
@JordanMartinez what happens here is that Docker by default runs all commands as root (unless you specify otherwise), combined with the fact that npm installs binaries as The result is that installing spago with npm running as root will never work, unless |
@f-f Gotcha. Thanks for clarifying that for me. |
@JordanMartinez you're welcome! 🙂 |
I have a container for this that reproduces the issue: 305e449d39b9a146f5bfca1f335a80cd2c2bebe0 at https://github.com/bbarker/purescript-hodgepodge, or just use master's HEAD for now.
To run the container, use
psc.sh
in the repo, or a modified version that has fewer mounts, though I'm not sure what the behavior will be (should be mostly fine though). To build the container, you can runbuild.socker.sh
.The text was updated successfully, but these errors were encountered: