Git Product home page Git Product logo

Comments (11)

hdgarrood avatar hdgarrood commented on July 21, 2024

Installing via npm doesn’t normally create a purs.ps1 file, as far as I’m aware, so that might be what’s causing it to get tripped up. Can you let me know what version of npm you’re using and can you also show us the contents of that file please?

from npm-installer.

garyb avatar garyb commented on July 21, 2024

I think it might if you're using npm in powershell, similar to the way it creates a batch file when using cmd.

from npm-installer.

garyb avatar garyb commented on July 21, 2024

Here's some more info on this issue actually: https://discourse.purescript.org/t/why-not-purs-exe-instead-of-purs-bin/1737

Seems to be to do with the local configuration.

from npm-installer.

shishini avatar shishini commented on July 21, 2024

I was using powershell version 7.1.0 and npm version 7.3.0

And for the record, it is in my path

PS C:\Users\ammsel> get-command purs

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
ExternalScript  purs.ps1                                                      C:\Users\ammsel\AppData\Roaming\npm\purs.ps1

PS C:\Users\ammsel> ($env:Path).Split(";") | Select-String -pattern "npm"

C:\Users\ammsel\AppData\Roaming\npm

PS C:\Users\ammsel>

from npm-installer.

shishini avatar shishini commented on July 21, 2024

Some more details
So it seems that powershell calls purs.ps1 which does not work
but the old command prompt calls purs.cmd which work

If I explicitly call purs.cmd from command shell it works

PS C:\Users\ammsel> purs.bin --version
purs.bin: The term 'purs.bin' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
PS C:\Users\ammsel> purs.ps1 --version
ResourceUnavailable: C:\Users\ammsel\AppData\Roaming\npm\purs.ps1:10
Line |
  10 |  & "$basedir/node_modules/purescript/purs.bin"   $args
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Program 'purs.bin' failed to run: No application is associated with the specified file for this operation.At C:\Users\ammsel\AppData\Roaming\npm\purs.ps1:10 char:1 + &
     | "$basedir/node_modules/purescript/purs.bin"   $args + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.

PS C:\Users\ammsel> purs.cmd --version
0.13.8
PS C:\Users\ammsel>

from npm-installer.

garyb avatar garyb commented on July 21, 2024

Does the solution in the linked discourse thread work? This in particular: https://discourse.purescript.org/t/why-not-purs-exe-instead-of-purs-bin/1737/13

from npm-installer.

hdgarrood avatar hdgarrood commented on July 21, 2024

I wonder if we should consider renaming it to purs.exe. As far as I know, Windows is the only OS with hangups about what executables can be called; I don't think having it be called purs.exe will cause any harm on other OSes, apart from potentially people thinking they've been shipped the wrong executable.

from npm-installer.

shishini avatar shishini commented on July 21, 2024

I kinda fixed it
I made a copy of purs.bin renamed it to purs.exe
and edited purs.ps1 to point to purs.exe

and now both purs.cmd and purs.exe work in their respective environments

from npm-installer.

shishini avatar shishini commented on July 21, 2024

I did not try the solution in the discourse forum

from npm-installer.

garyb avatar garyb commented on July 21, 2024

I wonder if we should consider renaming it to purs.exe. As far as I know, Windows is the only OS with hangups about what executables can be called; I don't think having it be called purs.exe will cause any harm on other OSes, apart from potentially people thinking they've been shipped the wrong executable.

Yeah, agreed - just figured we should be 100% sure that this is being caused by the same thing. From what @shishini has done to fix it locally, sounds like it is indeed. Thanks!

from npm-installer.

shishini avatar shishini commented on July 21, 2024

Just a reminder that this issue still exist, and when i updated purescript to version 0.14.2 (from 0.13.8),
i had to redo the manual fix

in C:\Users\<username>\AppData\Roaming\npm\node_modules\purescript
i made a copy of purs.bin and renamed it (the copy) to purs.exe

and i edited C:\Users\<username>\AppData\Roaming\npm\purs.ps1
s/purs.bin/purs.exe/
i replaced purs.bin with purs.exe

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.