Coder Social home page Coder Social logo

Comments (4)

seriousManual avatar seriousManual commented on July 16, 2024 2

works like a charm, thanks everybody! :)

from npx.

zkat avatar zkat commented on July 16, 2024

I think this is likely to be the same issue, yeah.

Is this also on Powershell? I'll take a look on Windows tomorrow and see what's up. I know I've had some Windows users for a while, now.

from npx.

seriousManual avatar seriousManual commented on July 16, 2024

this is cmd.exe

how do you approach developing npx?
mabye i can try to take a stab at the windows issues

from npx.

katemihalikova avatar katemihalikova commented on July 16, 2024

I wasn't using npx in last few days so I didn't notice it's not working for several major versions for me :)

Tried running different versions today: running not installed packages stopped working since v6.0.0 and running both locally and globally installed packages stopped working since v6.2.0 on my box. Error message is npx: command not found: cowsay all the time.

I'm not experienced in processes and spawning etc. so it's probably a naive approach but when I set shell: true in options for require('child_process').spawn in child.js line 10/11, it started working fine (at least partially, not installed packages still fail with the #58 problem).

There is a related note in node docs:

(...) On Unix-type operating systems (Unix, Linux, macOS) child_process.execFile() can be more efficient because it does not spawn a shell. On Windows, however, .bat and .cmd files are not executable on their own without a terminal, and therefore cannot be launched using child_process.execFile(). When running on Windows, .bat and .cmd files can be invoked using child_process.spawn() with the shell option set, (...) or by spawning cmd.exe and passing the .bat or .cmd file as an argument (...).

I have Windows 10 and I've tried all of that in cmd.exe, but the results are the same for bash.exe (aka Git Bash) too. I have node 6.9.4 and tried npx 5.4.0 (works fine), 6.0.0 (not installed packages stopped working), 6.1.0, 6.2.0 (globally and locally installed packages stopped working), 7.0.0, 8.1.1, 9.0.3 (bundled), and 9.0.7 (standalone) (still not working). I tried the fix above with 8.1.1 and 9.0.7 (both bundled and standalone).

from npx.

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.