繁体   English   中英

ng 构建失败并显示“您正在运行 Node.js 的 v8.11.3 版本,Angular CLI 8.0+ 不支持该版本。”

[英]ng build fails with “You are running version v8.11.3 of Node.js, which is not supported by Angular CLI 8.0+.”

我试图重现 spring/angular [tutorial][1],但我无法运行 ng build 命令(通过 maven)。 我多次重新安装了 nodejs msi 安装程序,但它仍然说我的节点版本不受支持。 我对 angular 很陌生,不知道在这里做什么。 我发现很多相关问题可以通过 npm 缓存清理和 npm 更新来解决,但它并没有解决我的问题

windows 10(64位)

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

您正在使用 maven-fronted-plugin 安装和执行 node/npm 的本地分发,而不是全局安装的常规二进制文件。 有关 maven pom.Z0F635D0E0F3874FFF8B581C132E6C7A7 文件中所需节点版本的配置,请参见https://github.com/eirslett/frontend-maven-plugin

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM