Comments (11)
Ah! that's a much more common problem: https://github.com/purescript/purescript/blob/master/INSTALL.md#the-curses-library
from npm-installer.
Glad you got it working. 🙂
This particular problem has tripped up many people, we've had some discussion about whether we should just drop the dependency to avoid it (at the expense of the repl experience), and I think a few other ideas to possibly work around it, but just haven't settled on an answer for it yet.
from npm-installer.
Would it be possible to prevent such issues in the future by adding some message in the script that says, "Hey, if this fails to install PureScript, you might need to install the libncurses5
" or something like that?
from npm-installer.
I think you're not supposed to sudo
when using npm install -g
. If you were doing that to work around an EACCES
error, then there's this in the npm docs: https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally
from npm-installer.
Apparently, as of npm v7, when npm is run as root, scripts are always run with the effective uid and gid of the working directory owner. https://docs.npmjs.com/cli/v7/using-npm/scripts#user
I think this might be related to the issue you're seeing. I think what might be happening is that install-purescript
is encountering a permission error and exiting silently, in which case we probably ought to have it fail more loudly with a non-zero exit code.
from npm-installer.
If I try to run without sudo
I get the following different set of errors:
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! code 1
npm ERR! path /home/jared/.nvm/versions/node/v15.12.0/lib/node_modules/purescript
npm ERR! command failed
npm ERR! command sh -c install-purescript --purs-ver=0.14.0
npm ERR! [ SUCCESS ] Check if a prebuilt 0.14.0 binary is provided for linux (602ms)
npm ERR! [ SUCCESS ] Download the prebuilt PureScript binary (683ms)
npm ERR! [ FAILURE ] Verify the prebuilt binary works correctly
npm ERR! Error: Command failed: /home/jared/.nvm/versions/node/v15.12.0/lib/node_modules/purescript/purs.bin --version
npm ERR! /home/jared/.nvm/versions/node/v15.12.0/lib/node_modules/purescript/purs.bin: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
npm ERR!
npm ERR! at ChildProcess.exithandler (node:child_process:326:12)
npm ERR! at ChildProcess.emit (node:events:369:20)
npm ERR! at maybeClose (node:internal/child_process:1067:16)
npm ERR! at Socket.<anonymous> (node:internal/child_process:453:11)
npm ERR! at Socket.emit (node:events:369:20)
npm ERR! at Pipe.<anonymous> (node:net:665:12)
npm ERR!
npm ERR! ↓ Fallback: building from source
npm ERR!
npm ERR! [ FAILURE ] Check if 'stack' command is available
npm ERR! Error: Command failed with exit code 2 (ENOENT): stack --allow-different-user --numeric-version
npm ERR! spawn stack ENOENT
npm ERR! at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
npm ERR! at onErrorNT (node:internal/child_process:480:16)
npm ERR! at processTicksAndRejections (node:internal/process/task_queues:81:21)
npm ERR! A complete log of this run can be found in:
npm ERR! /home/jared/.npm/_logs/2021-03-23T15_41_43_134Z-debug.log
from npm-installer.
Yep running sudo apt install libncurses5
and reinstalling via NPM solved the issue. I appreciate your time!
from npm-installer.
@garyb Yes, I can see how this would have been an issue for others as well. I don't know what the best solution for that would be, but I'll think about it and reach out if I have any ideas.
from npm-installer.
Would it be possible to prevent such issues in the future by adding some message in the script that says, "Hey, if this fails to install PureScript, you might need to install the
libncurses5
" or something like that?
That could be a good solution! If this project is looking for new contributors I would be up to tackle the implementation of that if people think it is an acceptable fix.
from npm-installer.
I'd prefer to just drop the ncurses dependency. It's a 4 line change in stack.yaml
in the compiler, we just need to do the same as what we did here: https://github.com/purescript/spago/pull/684/files
from npm-installer.
If anyone arrived here having trouble installing PureScript on TravisCI I found the following worked.
sudo apt-get install libncurses5 libncurses5-dev
curl -L https://github.com/purescript/purescript/releases/download/v0.14.0/linux64.tar.gz --output linux64.tar.gz
tar -xzf linux64.tar.gz purescript/purs --strip-components=1
sudo mv purs /usr/local/bin/purs
Installing with npm after having installed libncurses5 did not resolve the issue and still resulted in:
npm ERR! [ FAILURE ] Check if 'stack' command is available
as @jaredforth had above.
Installing the PureScript version 0.14.1 binary resulted in:
purs: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by purs)
from npm-installer.
Related Issues (20)
- Simplify installation HOT 3
- Unable to install purescript HOT 2
- `npm install purescript` stuck HOT 10
- alpine linux: Failed at the [email protected] postinstall script HOT 15
- Readme: dead link HOT 1
- Make the installer stable HOT 2
- installation failure (Cannot find module 'psl') HOT 3
- Installing the purescript npm package fails HOT 17
- Improve error message if the `purs` binary's dynamic loader does not exist
- Supply the --nix flag to stack if we appear to be on Nix/NixOS HOT 2
- Include output from `stack` when building from source HOT 1
- purs --version raise error , probably installation issue HOT 11
- Add abitlity to skip binary installation
- Unable to install purescript on Ubuntu 20.04 LTS HOT 6
- install with yarn on void linux musl HOT 5
- Update package dependencies
- Installer fails in docker HOT 5
- Building from source doesn't seem to work
- Use the new aarch64 releases when applicable HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from npm-installer.