LIFERAY和Angular集成

时间:2018-11-22 16:28:43

标签: angular npm liferay liferay-ide liferay-7.1

我正在尝试运行示例项目https://github.com/liferay/liferay-blade-samples/tree/7.0/gradle/apps/npm/angular-npm-portlet,但是执行后 npm intallnpm run build我有一个奇怪的错误(打开的文件太多),我无法继续前进

 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

输出服务

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)

1 个答案:

答案 0 :(得分:0)

添加

"process-serially": true

到'.npmbundlerrc'文件。

这使 liferay-npm-bundler 可以串行处理文件。进行此更改后,将不使用node.js的异步模型。

参考:liferay dxp configure npm bundler