Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] #98 breaks AIX #103

Closed
1 task done
lux01 opened this issue Aug 11, 2022 · 3 comments
Closed
1 task done

[BUG] #98 breaks AIX #103

lux01 opened this issue Aug 11, 2022 · 3 comments
Labels
Needs Triage needs an initial review

Comments

@lux01
Copy link

lux01 commented Aug 11, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When using npm@8.17.0 with @npmcli/run-script@4.2.1 on AIX (Node.js 14.20.0) postinstall scripts do not run because the default shell command sh (which is an alias for the Korn shell ksh) does not support the -- syntax:

$ uname
AIX
$ oslevel -s
7200-05-03-2148
$ sh -c -- echo hello world
echo: --:  not found
$ ksh -c -- echo hello world
echo: --:  not found
$ ksh93 -c -- echo hello world

This causes failures whenevere a postinstall, or indeed any, lifecycle script needs to be run

> @my-enterprise/my-package@1.0.0 postinstall
> npm list || echo done

npm list || echo done: --:  not found
npm ERR! code 127
npm ERR! path /build/jenkins/slot0/product-build/nodejs
npm ERR! command failed
npm ERR! command sh -c -- npm list || echo done

npm ERR! A complete log of this run can be found in:
npm ERR!     /build/jenkins/slot0/.npm/_logs/2022-08-11T03_41_16_217Z-debug-0.log

Expected Behavior

I expect npm to be able to run scripts on AIX without having to install Bash and set the script-shell setting on every machine.

Steps To Reproduce

  1. On AIX with Node.js v14.20.0, npm@8.17.0 and @npmcli/run-script@4.2.1
  2. Without script-shell set
  3. Create a new package and add a script
    "scripts": {
      "hello": "echo hello world"
    },
    
  4. Run npm run hello and observe it fails with
    $ npm run hello
    
    > package@1.0.0 hello
    > echo hello world
    
    echo hello world: --:  not found
    

Environment

  • npm: 8.17.0
  • Node: 14.20.0
  • OS: AIX 7.2 TL3
  • platform: AIX
@Brooooooklyn
Copy link

And FreeBSD

@ThePrez
Copy link

ThePrez commented Aug 26, 2022

And IBM i

@nlf
Copy link
Contributor

nlf commented Nov 1, 2022

version 5.1.0 of this package resolves this bug, it should be included in the next npm release later this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Triage needs an initial review
Projects
None yet
Development

No branches or pull requests

4 participants