New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running an error after the latest version is released #12417
Running an error after the latest version is released #12417
Comments
What version of Node do you use? AFAIR ??= assignment operator was added in v15/v16 so you shouldn't see any errors on Node 18 |
I use PM2 for project initiation |
@xxwangkaimin Make sure you are using nodejs v16 or greater. That's required in Nestjs v10 |
The nodejs version in Linux services is 18.18.0 |
Please provide a minimum reproduction repository (Git repository/StackBlitz/CodeSandbox project). why reproductions are requiredMost of us are using nest's latest version without an issue on node 16+. Whatever is going on seems to be localized and we need a way to actually reproduce it |
@xxwangkaimin please run this in your terminal: node -v
node -p "let a; a ??= 123" you should see Everything went fine here in v18.15.0 on Linux |
I can output 123 according to your method |
@xxwangkaimin in that case, share some full code that reproduces your issue along with the steps to reproduce it. |
I used npm i - legacy peer deps when installing dependencies, but I'm not sure if it's related to this.I have no problem developing and running locally. Once packaged and released for production, it won't work |
Where do you deploy for production? Is it using the same node version as you use for development? |
I released production on an Alibaba Cloud Linux server, and the node versions of the production and development environments are consistent |
I created a basic project using the command line to publish a project in the production environment. The basic project created with the command 'next new project-name' does not have any other features and there are no issues with the development environment. If I directly publish it to the production environment, an error will be reported |
This is purely an issue with your production environment not using the versions expected. We cannot debug this without knowing all the details. Now then likely pm2 is using some other node version then expected. Why? No clue, we don't have access to that. But this is not an issue with the framework |
However, upgrading the version of Nodejs in the production environment from v16 to v18 has no effect |
This worked for me! Thank you! |
Updating for Node 18 also worked for me |
解决了吗,我用阿里云的服务器也遇到这个问题了 |
@dingyl666 我是阿里云服务器升级pm2到最新版本解决的 |
我的pm2就是最新版本 不过我已经解决了 执行了一下pm2 kill就莫名其妙的好了 |
兄弟,你用的pm2哪个版本啊,我安装最新版依然有这个报错 |
@floruitShow2 我当时更新的时候pm2最新版本是 5.3.0 |
Is there an existing issue for this?
Current behavior
node_modules/@nestjs/common/file-stream/streamable-file.js:31
this.options.length ??= bufferOrReadStream.length;
^^^
SyntaxError: Unexpected token '??='
Minimum reproduction code
https://github.com/nestjs/typescript-starter
Steps to reproduce
No response
Expected behavior
normal operation
Package
@nestjs/common
@nestjs/core
@nestjs/microservices
@nestjs/platform-express
@nestjs/platform-fastify
@nestjs/platform-socket.io
@nestjs/platform-ws
@nestjs/testing
@nestjs/websockets
Other package
No response
NestJS version
10.2.5
Packages versions
Node.js version
18.18.0
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: