You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Packages like "esbuild" contain platform specific dependencies. Something has changed in the latest npm upgrade where these dependencies are handled differently now. This leads to them no longer being installed by default. The "missing" dependency causes generate-license-file to throw an error.
How are you using generate-license-file?
CLI
What version of generate-license-file are you using?
4.0
⠙ Resolving licenses...G:\source\repos\license-bug\node_modules\generate-license-file\src\lib\utils\packageJson.utils.js:9
throw new Error(`Cannot find the file: '${pathToPackageJson}'`);
^
Error: Cannot find the file: 'G:\source\repos\license-bug\node_modules\@esbuild\aix-ppc64\package.json'
at G:\source\repos\license-bug\node_modules\generate-license-file\src\lib\utils\packageJson.utils.js:9:15
at Generator.next (<anonymous>)
at fulfilled (G:\source\repos\license-bug\node_modules\tslib\tslib.js:167:62)
Node.js v22.13.0
The mentioned file and directory do indeed not exist. There is no directory G:\source\repos\license-bug\node_modules\@esbuild\aix-ppc64.
When I downgrade to npm 11.2, everything works as expected.
Expected behavior
License file should be created an no error should be thrown.
It would be cool if generate-license-file could detect the architecture and automatically exclude packages not used for the build. (Maybe this could even be expanded to OS specific packages?)
An option to ignore missing dependencies would also solve this issue and might be easier to implement.
Screenshots
n/a
Desktop (please complete the following information):
Windows 11 - x64
Additional context
I looked at manually excluding these dependencies as a workaround, but can not get that to work. Even excluding all of esbuild "exclude": ["[email protected]"] does not work for me.
I think the npm-change responsible is npm/cli#8184 to fix this long standing npm issue: npm/cli#4828
The text was updated successfully, but these errors were encountered:
Describe the bug
Packages like "esbuild" contain platform specific dependencies. Something has changed in the latest npm upgrade where these dependencies are handled differently now. This leads to them no longer being installed by default. The "missing" dependency causes generate-license-file to throw an error.
How are you using generate-license-file?
CLI
What version of generate-license-file are you using?
4.0
To Reproduce
Steps to reproduce the behavior:
My sample project looks like this:
Run:
I get (using x64 Windows laptop):
The mentioned file and directory do indeed not exist. There is no directory
G:\source\repos\license-bug\node_modules\@esbuild\aix-ppc64
.When I downgrade to npm 11.2, everything works as expected.
Expected behavior
License file should be created an no error should be thrown.
It would be cool if generate-license-file could detect the architecture and automatically exclude packages not used for the build. (Maybe this could even be expanded to OS specific packages?)
An option to ignore missing dependencies would also solve this issue and might be easier to implement.
Screenshots
n/a
Desktop (please complete the following information):
Windows 11 - x64
Additional context
I looked at manually excluding these dependencies as a workaround, but can not get that to work. Even excluding all of esbuild
"exclude": ["[email protected]"]
does not work for me.I think the npm-change responsible is npm/cli#8184 to fix this long standing npm issue: npm/cli#4828
The text was updated successfully, but these errors were encountered: