admin管理员组

文章数量:1033649

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

今天安装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 .html#cli_unhandled_rejections_mode). (rejection id: 1)

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

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

今天安装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 .html#cli_unhandled_rejections_mode). (rejection id: 1)

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

本文标签: npm 提示UnhandledPromiseRejectionWarning SyntaxError Unexpected token ’ 错误的