Closed xxwangkaimin closed 1 year ago
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
您使用什么版本的节点?AFAIR ??= 赋值运算符已在 v15/v16 中添加,因此您不应在 Node 18 上看到任何错误
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
json module.exports = { apps: [ { name: 'nest-manage-stage', script: 'dist/main.js', args: '', watch: true, ignore_watch: ['node_modules', 'public', 'logs'], exec_mode: 'cluster_mode', instances: '1', autorestart: true, max_memory_restart: '500M', merge_logs: true, log_date_format: 'YYYY-MM-DD HH:mm:ss', min_uptime: '60s', max_restarts: 30, restart_delay: 60, env_staging: { NODE_ENV: 'staging', PORT: '4000', } ] }
start command:
"pm2:stage": "pm2 start ecosystem.config.js --env staging"
@xxwangkaimin Make sure you are using nodejs v16 or greater. That's required in Nestjs v10
@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).
Most 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 123
Everything went fine here in v18.15.0 on Linux
@xxwangkaimin please run this in your terminal:
node -v node -p "let a; a ??= 123"
you should see
123
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.
@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?
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
请提供最小复制存储库(Git 存储库/ StackBlitz / CodeSandbox项目)。
为什么需要复制品
我们大多数人都使用 Nest 的最新版本,在 Node 16+ 上没有出现问题。无论发生什么似乎都是本地化的,我们需要一种方法来实际重现它
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
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
@xxwangkaimin Make sure you are using nodejs v16 or greater. That's required in Nestjs v10
This worked for me! Thank you!
Updating for Node 18 also worked for me
解决了吗,我用阿里云的服务器也遇到这个问题了
@dingyl666 我是阿里云服务器升级pm2到最新版本解决的
@dingyl666我是阿里云服务器升级pm2到最新版本解决的
我的pm2就是最新版本 不过我已经解决了 执行了一下pm2 kill就莫名其妙的好了
@dingyl666 我是阿里云服务器升级pm2到最新版本解决的
兄弟,你用的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
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