Comments (11)
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.
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.
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.
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.
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.
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.
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.
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.
I did not try the solution in the discourse forum
from npm-installer.
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 calledpurs.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.
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)
- 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
- 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
- NPM Installation Issue HOT 11
- 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.