Сбой сборки ng: «Вы используете версию Node.js v8.11.3, которая не поддерживается Angular CLI 8.0+». - PullRequest
0 голосов
/ 18 октября 2019

Я пытался воспроизвести пружинный / угловой [учебник] [1], но я не могу запустить команду сборки ng (от maven). Я несколько раз переустанавливал установщик nodejs msi, но он по-прежнему говорит, что версия моего узла не поддерживается. Я очень плохо знаком с angular и понятия не имею, что здесь делать. Я обнаружил множество связанных проблем, которые можно решить с помощью очистки кэша npm и обновления npm, но это не решает мою проблему

windows 10 (64bit)

me> npm -v
6.9.0

me>node -v
v10.16.3



[INFO] > ng build
[INFO]
[ERROR] You are running version v8.11.3 of Node.js, which is not supported by Angular CLI 8.0+.
[ERROR] The official Node.js version that is supported is 10.9 or greater.
[ERROR]
[ERROR] Please visit https://nodejs.org/en/ to find instructions on how to update Node.js.
[ERROR] npm ERR! code ELIFECYCLE
[ERROR] npm ERR! errno 3
[ERROR] npm ERR! frontend@0.0.0 build: `ng build`
[ERROR] npm ERR! Exit status 3
[ERROR] npm ERR!
[ERROR] npm ERR! Failed at the frontend@0.0.0 build script.
[ERROR] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[ERROR]
[ERROR] npm ERR! A complete log of this run can be found in:
[ERROR] npm ERR!     C:\Users\example\AppData\Roaming\npm-cache\_logs\2019-10-18T18_24_53_469Z-debug.log
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] example 1.0-SNAPSHOT    ............................ SUCCESS [  0.384 s]
[INFO] frontend ........................................... FAILURE [ 13.778 s]
[INFO] backend 1.0-SNAPSHOT ............................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.609 s
[INFO] Finished at: 2019-10-18T20:24:53+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.3:npm (npm run build) on project frontend: Failed to run task: 'npm run bu
ild' failed. (error code 3) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :frontend


  [1]: https://dzone.com/articles/building-a-web-app-using-spring-boot-angular-6-and

1 Ответ

1 голос
/ 18 октября 2019

Вы используете maven-fronted-plugin для установки и выполнения локального дистрибутива узла / npm, а не глобально установленных обычных двоичных файлов. См. https://github.com/eirslett/frontend-maven-plugin для конфигурации желаемой версии узла в файле maven pom.xml.

...