在项目“前端”中找不到目标“服务器”

时间:2019-03-11 05:00:25

标签: angular

我正在使用Angular 6,并尝试从几天开始构建应用程序服务器端渲染。

我不断遇到如下错误

    Target 'server' could not be found in project 'i18n'.
Error: Target 'server' could not be found in project 'i18n'.
    at Architect._getProjectTarget (/home/sada/Downloads/i18n/node_modules/@angular/cli/node_modules/@angular-devkit/architect/src/architect-legacy.js:111:19)
    at Architect.getBuilderConfiguration (/home/sada/Downloads/i18n/node_modules/@angular/cli/node_modules/@angular-devkit/architect/src/architect-legacy.js:118:29)
    at RunCommand.runSingleTarget (/home/sada/Downloads/i18n/node_modules/@angular/cli/models/architect-command.js:160:45)
    at RunCommand.runArchitectTarget (/home/sada/Downloads/i18n/node_modules/@angular/cli/models/architect-command.js:201:35)
    at RunCommand.run (/home/sada/Downloads/i18n/node_modules/@angular/cli/commands/run-impl.js:14:25)
    at RunCommand.validateAndRun (/home/sada/Downloads/i18n/node_modules/@angular/cli/models/command.js:124:31)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
    at Function.Module.runMain (module.js:695:11)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3

npm ERR! Linux 4.15.0-43-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "build:client-and-server-bundles-i18n"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! i18n@1.0.0 build:client-and-server-bundles-i18n: `ng run i18n:build:production-en && ng run i18n:build:production-fr && ng run i18n:server:production`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the i18n@1.0.0 build:client-and-server-bundles-i18n script 'ng run i18n:build:production-en && ng run i18n:build:production-fr && ng run i18n:server:production'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the i18n package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ng run i18n:build:production-en && ng run i18n:build:production-fr && ng run i18n:server:production
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs i18n
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls i18n
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/sada/Downloads/i18n/npm-debug.log

npm ERR! Linux 4.15.0-43-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "build:i18n-ssr"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! i18n@1.0.0 build:i18n-ssr: `npm run build:client-and-server-bundles-i18n && npm run compile:server`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the i18n@1.0.0 build:i18n-ssr script 'npm run build:client-and-server-bundles-i18n && npm run compile:server'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the i18n package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run build:client-and-server-bundles-i18n && npm run compile:server
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs i18n
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls i18n
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/sada/Downloads/i18n/src/npm-debug.log

因为,我的项目名称为'frontend',并且在遵循https://angular-templates.io/tutorials/about/angular-internationalization-i18n-multi-language-app

上的完整文档之后,我正在执行如下所示的命令
npm run build:i18n-ssr && npm run serve:ssr

我能够做到这一点,并且在Angular 5上成功运行服务器端渲染。但是它在Angular 6上不起作用,我也遵循了Angular 6中所做的更改。

Angular 6有什么问题吗?谁能帮助我。

0 个答案:

没有答案