liferay / liferay-js-themes-toolkit

MIT License
26 stars 28 forks source link

npmInstall fails with package-lock.json #447

Closed luizfmarins closed 3 years ago

luizfmarins commented 4 years ago

I'm having a issue building my theme after updating gradle.plugins.workspace from version 1.10.7 to 2.1.14

Issue summary: If I have package-lock.json file but node_modules it not initialized yet, build fails.

Steps to reproduce:

  1. Checkout the sample repo: https://github.com/luizfmarins/raylife-theme-npm-issue

  2. Run gw clean deploy 2.1. Error:

    npm ERR! path /home/luizmarins/development/liferay/damage-control/lfrgs-liferay-damage-control/themes/raylife-customer-theme/node_modules/.staging/raylife-base-theme-1a97e6b4/node_modules/@sindresorhus/is
    npm ERR! code ENOENT
    npm ERR! errno -2
    npm ERR! syscall rename
    npm ERR! enoent ENOENT: no such file or directory, rename '/home/luizmarins/development/liferay/damage-control/lfrgs-liferay-damage-control/themes/raylife-customer-theme/node_modules/.staging/raylife-base-theme-1a97e6b4/node_modules/@sindresorhus/is' -> '/home/luizmarins/development/liferay/damage-control/lfrgs-liferay-damage-control/themes/raylife-customer-theme/node_modules/.staging/@sindresorhus/is-a15dcd00'
    npm ERR! enoent This is related to npm not being able to find a file.
    npm ERR! enoent
  3. Remove all package-lock.json and clean everything (find . -name "package-lock.json" -exec rm -fr '{}' +, git clean -xfd)

  4. gw clean deploy 4.1 BUILD SUCCESSFUL

  5. Clean workspace (git clean -xdf)

  6. gw clean deploy 5.1. Error:

    npm ERR! path /home/luizmarins/development/liferay/damage-control/lfrgs-liferay-damage-control/themes/raylife-customer-theme/node_modules/.staging/raylife-base-theme-1a97e6b4/node_modules/@sindresorhus/is
    npm ERR! code ENOENT
    npm ERR! errno -2
    npm ERR! syscall rename
    npm ERR! enoent ENOENT: no such file or directory, rename '/home/luizmarins/development/liferay/damage-control/lfrgs-liferay-damage-control/themes/raylife-customer-theme/node_modules/.staging/raylife-base-theme-1a97e6b4/node_modules/@sindresorhus/is' -> '/home/luizmarins/development/liferay/damage-control/lfrgs-liferay-damage-control/themes/raylife-customer-theme/node_modules/.staging/@sindresorhus/is-a15dcd00'
    npm ERR! enoent This is related to npm not being able to find a file.
    npm ERR! enoent 

Notes: It seems the issue is related too this dependency This issue might be related to https://github.com/npm/npm/issues/17025

wincent commented 3 years ago

We've just migrated this project to the liferay-frontend-projects monorepo in the name of consolidation. As this issue is quite old now, I'm not going to transfer it automatically. If you consider it to be still relevant, please create a fresh issue over in the new repo.