首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >npm 提示:UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token ‘??=’ 错误的

npm 提示:UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token ‘??=’ 错误的

原创
作者头像
Power
发布2025-03-31 13:06:52
发布2025-03-31 13:06:52
65700
代码可运行
举报
运行总次数:0
代码可运行

今天安装laravel/breeze套件时,运行npm run dev命令遇到报错,错误详细代码如下:

代码语言:javascript
代码运行次数:0
运行
复制
UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token '??='
at Loader.moduleStrategy (internal/modules/esm/translators.js:145:18)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:8744) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)

看了半天也不明白是啥意思,后来搜索了一下发现应该是nodejs版本过低的问题,于是升级了一下nodejs版本,从v14.17.6升级到v20.12.1。再次运行命令,成功执行,问题解决。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档