Coder Social home page Coder Social logo

unexpected result about zx HOT 4 CLOSED

google avatar google commented on May 2, 2024
unexpected result

from zx.

Comments (4)

Artoria2e5 avatar Artoria2e5 commented on May 2, 2024 1

Good, now I just need #45 done.

from zx.

Artoria2e5 avatar Artoria2e5 commented on May 2, 2024

This is a bit odd since I am apparently failing to reproduce this bug. Here's what I did:

  • Open Git Bash (assumed to be your setup since you have that big MINGW64)
  • Go to where zx is
  • Go to the "examples" folder because I am too lazy to create one
  • Save the script as test.mjs (bad name, I know)
  • Run node ../zx.mjs file:///c:/Users/art/GH/zx/examples/test.mjs
art@REDACTED MINGW64 ~/GH/zx/examples (wind)
$ node ../zx.mjs file:///c:/Users/art/GH/zx/examples/test.mjs
$ cat ../package.json | grep name | cut -d":" -f 2 | cut -d',' -f1
 "zx"
ProcessOutput {}

It could be that one of the updates fixed the issue, since a lot of commits changes came through in the last two days. Try updating zx first. (I don't really have an explanation of what could've caused it in the first place, let alone what fixed it.)

from zx.

SilurianYang avatar SilurianYang commented on May 2, 2024

I update zx from v1.1.1 to v 1.2.2. Invalid and a new problem occurred

cmd

F:\codeTest\jsToSh\src>zx file:///F:/codeTest/jsToSh/src/index.mjs
'command' �����ڲ����ⲿ���Ҳ���ǿ����еij���
�������ļ�
'which' �����ڲ����ⲿ���Ҳ���ǿ����еij���
�������ļ�
ϵͳ�Ҳ���ָ�����ļ�
����: -p ʱ���
ϵͳ�Ҳ���ָ�����ļ�
����: bash ʱ���
child_process.js:616
    err = new Error(msg);
          ^

Error: Command failed: command -v bash || which bash || type -p bash
'command' �����ڲ����ⲿ���Ҳ���ǿ����еij���
���������ļ���
'which' �����ڲ����ⲿ���Ҳ���ǿ����еij���
���������ļ���
ϵͳ�Ҳ���ָ�����ļ���
����: -p ʱ������
ϵͳ�Ҳ���ָ�����ļ���
����: bash ʱ������

    at checkExecSyncError (child_process.js:616:11)
    at execSync (child_process.js:652:15)
    at file:///C:/Users/Administrator/AppData/Roaming/npm/node_modules/zx/index.mjs:75:14
    at ModuleJob.run (internal/modules/esm/module_job.js:152:23)
    at async Loader.import (internal/modules/esm/loader.js:166:24)
    at async Object.loadESM (internal/process/esm_loader.js:68:5) {
  status: 1,
  signal: null,
  output: [
    null,
    Buffer(0) [Uint8Array] [],
    Buffer(218) [Uint8Array] [
       39,  99, 111, 109, 109,  97, 110, 100,  39,  32, 178, 187,
      202, 199, 196, 218, 178, 191, 187, 242, 205, 226, 178, 191,
      195, 252, 193, 238, 163, 172, 210, 178, 178, 187, 202, 199,
      191, 201, 212, 203, 208, 208, 181, 196, 179, 204, 208, 242,
       13,  10, 187, 242, 197, 250, 180, 166, 192, 237, 206, 196,
      188, 254, 161, 163,  13,  10,  39, 119, 104, 105,  99, 104,
       39,  32, 178, 187, 202, 199, 196, 218, 178, 191, 187, 242,
      205, 226, 178, 191, 195, 252, 193, 238, 163, 172, 210, 178,
      178, 187, 202, 199,
      ... 118 more items
    ]
  ],
  pid: 13356,
  stdout: Buffer(0) [Uint8Array] [],
  stderr: Buffer(218) [Uint8Array] [
     39,  99, 111, 109, 109,  97, 110, 100,  39,  32, 178, 187,
    202, 199, 196, 218, 178, 191, 187, 242, 205, 226, 178, 191,
    195, 252, 193, 238, 163, 172, 210, 178, 178, 187, 202, 199,
    191, 201, 212, 203, 208, 208, 181, 196, 179, 204, 208, 242,
     13,  10, 187, 242, 197, 250, 180, 166, 192, 237, 206, 196,
    188, 254, 161, 163,  13,  10,  39, 119, 104, 105,  99, 104,
     39,  32, 178, 187, 202, 199, 196, 218, 178, 191, 187, 242,
    205, 226, 178, 191, 195, 252, 193, 238, 163, 172, 210, 178,
    178, 187, 202, 199,
    ... 118 more items
  ]
}
F:\codeTest\jsToSh\src>

powerShell

PS F:\codeTest\jsToSh\src> zx file:///F:/codeTest/jsToSh/src/index.mjs
'command' �����ڲ����ⲿ���Ҳ���ǿ����еij���
�������ļ�
'which' �����ڲ����ⲿ���Ҳ���ǿ����еij���
�������ļ�
ϵͳ�Ҳ���ָ�����ļ�
����: -p ʱ���
ϵͳ�Ҳ���ָ�����ļ�
����: bash ʱ���
child_process.js:616
    err = new Error(msg);
          ^

Error: Command failed: command -v bash || which bash || type -p bash
'command' �����ڲ����ⲿ���Ҳ���ǿ����еij���
���������ļ���
'which' �����ڲ����ⲿ���Ҳ���ǿ����еij���
���������ļ���
ϵͳ�Ҳ���ָ�����ļ���
����: -p ʱ������
ϵͳ�Ҳ���ָ�����ļ���
����: bash ʱ������

    at checkExecSyncError (child_process.js:616:11)
    at execSync (child_process.js:652:15)
    at file:///C:/Users/Administrator/AppData/Roaming/npm/node_modules/zx/index.mjs:75:14
    at ModuleJob.run (internal/modules/esm/module_job.js:152:23)
    at async Loader.import (internal/modules/esm/loader.js:166:24)
    at async Object.loadESM (internal/process/esm_loader.js:68:5) {
  status: 1,
  signal: null,
  output: [
    null,
    Buffer(0) [Uint8Array] [],
    Buffer(218) [Uint8Array] [
       39,  99, 111, 109, 109,  97, 110, 100,  39,  32, 178, 187,
      202, 199, 196, 218, 178, 191, 187, 242, 205, 226, 178, 191,
      195, 252, 193, 238, 163, 172, 210, 178, 178, 187, 202, 199,
      191, 201, 212, 203, 208, 208, 181, 196, 179, 204, 208, 242,
       13,  10, 187, 242, 197, 250, 180, 166, 192, 237, 206, 196,
      188, 254, 161, 163,  13,  10,  39, 119, 104, 105,  99, 104,
       39,  32, 178, 187, 202, 199, 196, 218, 178, 191, 187, 242,
      205, 226, 178, 191, 195, 252, 193, 238, 163, 172, 210, 178,
      178, 187, 202, 199,
      ... 118 more items
    ]
  ],
  pid: 12040,
  stdout: Buffer(0) [Uint8Array] [],
  stderr: Buffer(218) [Uint8Array] [
     39,  99, 111, 109, 109,  97, 110, 100,  39,  32, 178, 187,
    202, 199, 196, 218, 178, 191, 187, 242, 205, 226, 178, 191,
    195, 252, 193, 238, 163, 172, 210, 178, 178, 187, 202, 199,
    191, 201, 212, 203, 208, 208, 181, 196, 179, 204, 208, 242,
     13,  10, 187, 242, 197, 250, 180, 166, 192, 237, 206, 196,
    188, 254, 161, 163,  13,  10,  39, 119, 104, 105,  99, 104,
     39,  32, 178, 187, 202, 199, 196, 218, 178, 191, 187, 242,
    205, 226, 178, 191, 195, 252, 193, 238, 163, 172, 210, 178,
    178, 187, 202, 199,
    ... 118 more items
  ]
}
PS F:\codeTest\jsToSh\src>

git Bash

Administrator@WIN-JH5VDQS6BP7 MINGW64 /f/codeTest/jsToSh/src
$ zx file:///F:/codeTest/jsToSh/src/index.mjs
'command' �����ڲ����ⲿ���Ҳ���ǿ����еij���
�������ļ�
$ cat ../package.json | grep name | cut -d":" -f 2 | cut -d',' -f1

Administrator@WIN-JH5VDQS6BP7 MINGW64 /f/codeTest/jsToSh/src
$ 

from zx.

SilurianYang avatar SilurianYang commented on May 2, 2024

I just need to wait

from zx.

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.