2

i am trying to run the example project https://github.com/liferay/liferay-blade-samples/tree/7.0/gradle/apps/npm/angular-npm-portlet but after executing npm intall and npm run build I have this strange error (too many open files) and I can't move on

 npm run build

> angular6-npm-portlet@1.0.0 build D:\ebitReload\LAB\liferay-blade-samples\gradle\apps\npm\angular6-npm-portlet
> tsc && liferay-npm-bundler

error TS18003: No inputs were found in config file 'D:/ebitReload/LAB/liferay-blade-samples/gradle/apps/npm/angular6-npm-portlet/tsconfig.json'. Specified 'include' paths were '["./build/resources/main/META-INF/resources/**/*.ts"]' and 'exclude' paths were '[]'.
Bundling 13 dependencies...
{ Error: EMFILE: too many open files, open 'D:\ebitReload\LAB\liferay-blade-samples\gradle\apps\npm\angular6-npm-portlet\package.json'
    at Object.fs.openSync (fs.js:646:18)
    at Object.fs.readFileSync (fs.js:551:33)
    at readJsonSync (D:\ebitReload\LAB\liferay-blade-samples\gradle\apps\npm\angular6-npm-portlet\node_modules\read-json-sync\index.js:10:31)
    at D:\ebitReload\LAB\liferay-blade-samples\gradle\apps\npm\angular6-npm-portlet\node_modules\liferay-npm-bundler\lib\runners.js:132:46
    at new Promise (<anonymous>)
    at D:\ebitReload\LAB\liferay-blade-samples\gradle\apps\npm\angular6-npm-portlet\node_modules\liferay-npm-bundler\lib\runners.js:127:11
    at Array.map (<anonymous>)
    at D:\ebitReload\LAB\liferay-blade-samples\gradle\apps\npm\angular6-npm-portlet\node_modules\liferay-npm-bundler\lib\runners.js:126:28
    at <anonymous>
  errno: -4066,
  code: 'EMFILE',
  syscall: 'open',
  path: 'D:\\ebitReload\\LAB\\liferay-blade-samples\\gradle\\apps\\npm\\angular6-npm-portlet\\package.json' }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! angular6-npm-portlet@1.0.0 build: `tsc && liferay-npm-bundler`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular6-npm-portlet@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\agelsomino\AppData\Roaming\npm-cache\_logs\2018-11-22T16_21_18_068Z-debug.log

OUTPUT ng serve

To disable this warning use "ng config -g cli.warnings.versionMismatch false".
Local workspace file ('angular.json') could not be found.
Error: Local workspace file ('angular.json') could not be found.
    at WorkspaceLoader._getProjectWorkspaceFilePath (D:\ebitReload\LAB\liferay-blade-samples\gradle\apps\npm\angular6-npm-portlet\node_modules\@angular\cli\models\workspace-loader.js:37:19)
    at WorkspaceLoader.loadWorkspace (D:\ebitReload\LAB\liferay-blade-samples\gradle\apps\npm\angular6-npm-portlet\node_modules\@angular\cli\models\workspace-loader.js:24:21)
    at ServeCommand._loadWorkspaceAndArchitect (D:\ebitReload\LAB\liferay-blade-samples\gradle\apps\npm\angular6-npm-portlet\node_modules\@angular\cli\models\architect-command.js:180:32)
    at ServeCommand.<anonymous> (D:\ebitReload\LAB\liferay-blade-samples\gradle\apps\npm\angular6-npm-portlet\node_modules\@angular\cli\models\architect-command.js:47:25)
    at Generator.next (<anonymous>)
    at D:\ebitReload\LAB\liferay-blade-samples\gradle\apps\npm\angular6-npm-portlet\node_modules\@angular\cli\models\architect-command.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (D:\ebitReload\LAB\liferay-blade-samples\gradle\apps\npm\angular6-npm-portlet\node_modules\@angular\cli\models\architect-command.js:3:12)
    at ServeCommand.initialize (D:\ebitReload\LAB\liferay-blade-samples\gradle\apps\npm\angular6-npm-portlet\node_modules\@angular\cli\models\architect-command.js:46:16)
    at Object.<anonymous> (D:\ebitReload\LAB\liferay-blade-samples\gradle\apps\npm\angular6-npm-portlet\node_modules\@angular\cli\models\command-runner.js:87:23)
Gelso77
  • 1,763
  • 6
  • 30
  • 47
  • What is the output of `ng serve`??? – ram12393 Nov 22 '18 at 16:50
  • thanks Geek. I 've updated the question with the output. – Gelso77 Nov 22 '18 at 16:54
  • It is showing , you don't have angular.json... Please check it once – ram12393 Nov 22 '18 at 16:56
  • You're linking to a sample from the blade 7.0 tree, but you tag liferay-7.1 in the question's tags. Can you try starting over with an example that has been provided in the 7.1 tree? (might or might not be related to the particular problem at hand...) – Olaf Kock Dec 03 '18 at 14:28

1 Answers1

0

Add

"process-serially": true

to '.npmbundlerrc' file.

This makes liferay-npm-bundler to process files serially. With this change the asynchronous model of node.js will not be used.

Reference: liferay dxp configure npm bundler

Ravi Chandan
  • 3
  • 1
  • 4