zkat / npx

execute npm package binaries (moved)
https://github.com/npm/npx
Other
2.63k stars 105 forks source link

npx it not being tested in windows #168

Closed cekvenich closed 6 years ago

cekvenich commented 6 years ago

In windows, it does not run a global js via/in node.js npx instead runs via 'Microsoft JScript runtime' in windows, es5

To reproduce, run ES2016+ js, that would run on current version of node: A) via npx B) via 'node full_path_to_global_js_yarn_or_npm.js'

B runs as expected. A gives JScript errors. What is JScript?

If you want to test on a package, try A and B w/ https://github.com/pugjs/pug-cli

Main issue is project testing this process runner in windows, or at lest list any supported environments prominently. Even args in windows. Else it makes you think if node is a serious org.

cekvenich commented 6 years ago

Other than full path, the other way to fix this registry setting, can be done in GUI: https://www.dropbox.com/s/ws76r7sl6qqxoil/js.PNG?dl=0 You get to that screen via 'show desktop icons'.

Then you can just run it as normal command line node cli (| w/o npx) - from the windows menu called "node.js command prompt "

cekvenich commented 6 years ago

@rich-newman One way to 'monkey patch' is: node $Env:userprofile/WHERE-YOU-INSTALLED/node_modules/nbake/nbake.js . Where nbake is your npm module.

( my project where I do that is here, WIP http://github.com/topseed/nbake-user )

rich-newman commented 6 years ago

Oh I see. I was hoping for a workaround that would let me use npx without errors on Windows, because npx has some quite cool features.

cekvenich commented 6 years ago

Same here. I don't see source for npx.cmd so I can fix it for them.

Works fine on mac, linux, docker. Just Windows it does not work.

TotallyInformation commented 6 years ago

Given that npx is now distributed with Node.JS, this is a VERY IMPORTANT thing to fix!

I don't pretend to understand all of the technical details but please bear in mind that this - to users - is an npx error, not an npm error. That's because npm works just fine on Windows, npx does not.

I am not trying to be negative. This is a great tool and I want to see it succeed.

puppetmaster3 commented 6 years ago

TotallyInformation I do think the fix is: 'test on windows'.
And also I think that npx is part of node now, so it is node org that has a blemish.

Currently, I can't even find the source code for npx.cmd. What I did is identify the root cause, before my post all the reports on www said they could not ID the cause.

zkat commented 6 years ago

Closing this partially as a duplicate of https://github.com/zkat/npx/issues/144

Also closing this because npx is tested on Windows. You can see the appveyor page, which runs the npx test suite on Windows. Specific bugs will be specific bugs, but there's certainly a test suite, and it's certainly running on Windows. Please file issues for specific bugs.

cekvenich commented 6 years ago

Regarding ' npx is tested on Windows' - clearly the test are insufficient.

We would like node org to address and have sufficient testing on windows.

zkat commented 6 years ago

@cekvenich what the node org does is not my problem. I'm not involved with them, and I am not part of any of their teams. If you want their stuff to be tested better, go to their issue tracker.

And if you find a missing test, I'll gladly take a PR.

cekvenich commented 6 years ago

@zkat

  1. node org ships npx, so the management at node is responsible for this, this is their problem.
  2. It appears that at least from node POV, you are reporting to them and they think of you as a part of their team ( http://linkedin.com/in/katmarchan ) . But it appears you are right, they are not monitoring neither you, nor their project. As I said in this bug #168, they should state that windows is not supported in the read me here, no need for me to do a pr.
  3. In the issue tracker you mention, we have a bug that you closed: http://github.com/zkat/npx/issues/144 I asked for the patch or commit that fixed it - I suspect there are none? You said 'This should have been fixed ' , did you mean to say 'this has been open for a while, I should just close it'.

Node management should monitor their sr engineer, at least for ethics, like their monitor their projects. It reflects on node, if they should be considered a stable enterprise level platform. That is my takeaway from the two interactions I had with their sr engineer.

zkat commented 6 years ago

@cekvenich

  1. Yup, this is -their- problem, not mine. I'm still working to make npx work well. A bug is a bug, and I think your issue OP is overblown.
  2. node is not anywhere on my LinkedIn (which... it's a bit creepy for you to be looking up like that? just sayin'). I work for npm, Inc, which is a C Corporation that is 100% independent from the Node Foundation. We have a working relationship, but I am not, in any way, actually beholden to Node Core. I just try to cooperate with them as a separate person.
  3. https://github.com/npm/npm/pull/19608. Read the thread. It's in the thread. The thread that you commented in.

I'm not even going to respond to this last paragraph, but I -will- lock this issue. I look forward to accepting a PR from you fixing the issues you're having, in the spirit of Open Source and good ethics.