Skip to content

[BUG] #98 breaks AIX #103

Closed
Closed
@lux01

Description

@lux01

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions