Skip to content

npm install fails to install imx modules when directory has a space in itΒ #515

Description

@cypherkey

Is this a regression?

Yes

Severity

🟑 Minor – small but noticeable issue

Please provide the branch(es) you discovered this issue in

v100

Environment Details

Node 22.22, Windows Server 2019

Please provide a minimal set of steps to reproduce the issue

Repro steps:

  1. Install Node 22.22
  2. In Windows, create a directory called "One Identity Angular" and clone the imx repo
  3. Change to imxweb and run "npm install"

Description

Result:

Running command npm i @elemental-ui/cadence-icon@C:\One Identity\angular-v10\IdentityManager.Imx\imxweb\imx-modules\cadence-icon-3.1.111.tgz @elemental-ui/core@C:\One Identity\angular-v10\IdentityManager.Imx\imxweb\imx-modules\elemental-ui-core-20.0.76.tgz @imx-modules/imx-api-aad@C:\One Identity\angular-v10\IdentityManager.Imx\imxweb\imx-modules\imx-api-aad.tgz @imx-modules/imx-api-aob@C:\One Identity\angular-v10\IdentityManager.Imx\imxweb\imx-modules\imx-api-aob.tgz @imx-modules/imx-api-apc@C:\One Identity\angular-
...
'npm warn tarball tarball data for file:Identity/angular-v10/IdentityManager.Imx/imxweb/imx-modules/cadence-icon-3.1.111.tgz (null) seems to be corrupted. Trying again.\n' +

Describe what you expected to happen versus what actually happened

Notes:
The issue appears to be in imxweb\scripts\install-local-package.ts in the V100 branch. When installArg is built in lines 102-106, The filePath is not enclosed in quotation marks or escaped. The result is that the directory with a space is split and considered separate arguments to the npm command. I fixed this by putting a double quote around filePath but maybe there is a more elegant solution:

if (file.includes('imx-')) {
   const baseName = path.parse(file).name;
   installArg += [nodePackageDir, '/', baseName, '@"', filePath, '" '].join('');

Relevant logs or console output

Add a screenshot(s) if that helps illustrate the problem

No response

Suggested Fix

No response

Anything else?

No response

Before submitting...

  • I have searched for existing issues that match this one on github and on the community support page
  • I have included all necessary details to reproduce this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions