Git Product home page Git Product logo

Comments (11)

garyb avatar garyb commented on August 22, 2024 3

Ah! that's a much more common problem: https://github.com/purescript/purescript/blob/master/INSTALL.md#the-curses-library

from npm-installer.

garyb avatar garyb commented on August 22, 2024 1

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.

JordanMartinez avatar JordanMartinez commented on August 22, 2024 1

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.

garyb avatar garyb commented on August 22, 2024

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.

hdgarrood avatar hdgarrood commented on August 22, 2024

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.

jaredforth avatar jaredforth commented on August 22, 2024

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.

jaredforth avatar jaredforth commented on August 22, 2024

Yep running sudo apt install libncurses5 and reinstalling via NPM solved the issue. I appreciate your time!

from npm-installer.

jaredforth avatar jaredforth commented on August 22, 2024

@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.

jaredforth avatar jaredforth commented on August 22, 2024

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.

hdgarrood avatar hdgarrood commented on August 22, 2024

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.

JoelLefkowitz avatar JoelLefkowitz commented on August 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.