<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Error building Liferay Angular portlet</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121377004" />
  <subtitle>Error building Liferay Angular portlet</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121377004</id>
  <updated>2026-04-07T22:56:13Z</updated>
  <dc:date>2026-04-07T22:56:13Z</dc:date>
  <entry>
    <title>Error building Liferay Angular portlet</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121377003" />
    <author>
      <name>Piotr Woch</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121377003</id>
    <updated>2022-03-11T17:06:05Z</updated>
    <published>2022-03-11T10:08:35Z</published>
    <summary type="html">&lt;p&gt;Hello!&lt;/p&gt;
&lt;p&gt;I followed this blog post in an attempt to create a Liferay portlet
  that would allow me to embed by Angular app:&lt;/p&gt;
&lt;p&gt;
  &lt;a href="https://liferay.dev/blogs/-/blogs/how-to-migrate-angular-app-to-angular-widget-for-liferay-manually-https://liferay.dev/blogs/-/blogs/how-to-migrate-angular-app-to-angular-widget-for-liferay-manually-"&gt;https://liferay.dev/blogs/-/blogs/how-to-migrate-angular-app-to-angular-widget-for-liferay-manually-&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;One caveat is that when following the above instructions I noticed
  the portlet contains references to Angular 10 libraries, while my app
  runs still on Angular 9. I corrected the package.json so all the
  references point to versions related to Angular 9.&lt;/p&gt;
&lt;p&gt;I am getting an error “EMFILE: too many open files, open ‘(…)’ ”. I
  suspect it’s caused by the resolve NPM module (invoked by
  liferay-npm-bundler) having issues handling 1155 modules in my
  node_modules directory, running into the O/S (Windows) limit of number
  of open files. I would be grateful for answers to several questions I have:&lt;/p&gt;
&lt;p&gt;a) Is there any way to increase the limit of open files in Windows?&lt;/p&gt;
&lt;p&gt;b) If not, is there a way to “trim” the number of modules in
  node_modules, eg. by removing modules installed by npm install but not
  really referenced/used by the application?&lt;/p&gt;
&lt;p&gt;c) Is there any other workaround for this problem/error?&lt;/p&gt;
&lt;p&gt;Below are the details of the message I am getting:&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;Project assets copied.
Error: EMFILE: too many open files, open 'C:\liferay\LiferayWorkspacewithDevStudio7.4\liferay-workspace\modules\my-npm-angular-portlet2\node_modules\babel-preset-liferay-standard\package.json'
    at Object.openSync (fs.js:438:3)
    at readFileSync (fs.js:343:35)
    at defaultReadPackageSync (C:\liferay\LiferayWorkspacewithDevStudio7.4\liferay-workspace\modules\my-npm-angular-portlet2\node_modules\resolve\lib\sync.js:58:16)
    at loadpkg (C:\liferay\LiferayWorkspacewithDevStudio7.4\liferay-workspace\modules\my-npm-angular-portlet2\node_modules\resolve\lib\sync.js:151:19)
    at loadAsFileSync (C:\liferay\LiferayWorkspacewithDevStudio7.4\liferay-workspace\modules\my-npm-angular-portlet2\node_modules\resolve\lib\sync.js:116:19)
    at loadAsDirectorySync (C:\liferay\LiferayWorkspacewithDevStudio7.4\liferay-workspace\modules\my-npm-angular-portlet2\node_modules\resolve\lib\sync.js:191:16)
    at loadNodeModulesSync (C:\liferay\LiferayWorkspacewithDevStudio7.4\liferay-workspace\modules\my-npm-angular-portlet2\node_modules\resolve\lib\sync.js:203:25)
    at Function.resolveSync [as sync] (C:\liferay\LiferayWorkspacewithDevStudio7.4\liferay-workspace\modules\my-npm-angular-portlet2\node_modules\resolve\lib\sync.js:107:17)
    at Project.resolve (C:\liferay\LiferayWorkspacewithDevStudio7.4\liferay-workspace\modules\my-npm-angular-portlet2\node_modules\liferay-npm-build-tools-common\lib\project\index.js:228:34)
    at Project.toolResolve (C:\liferay\LiferayWorkspacewithDevStudio7.4\liferay-workspace\modules\my-npm-angular-portlet2\node_modules\liferay-npm-build-tools-common\lib\project\index.js:282:25)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-npm-angular-portlet2@1.0.0 build: `tsc &amp;amp;&amp;amp; npm run copy-assets &amp;amp;&amp;amp; liferay-npm-bundler`
npm ERR! Exit status 1
&lt;/code&gt;&lt;/pre&gt;</summary>
    <dc:creator>Piotr Woch</dc:creator>
    <dc:date>2022-03-11T10:08:35Z</dc:date>
  </entry>
</feed>
