Pm2 command line startup-- env parameter setting usage problem

individuals want to use pm2 to start the application using -- env parameters to specify some application variables. Check the document -- env usage can be set to a object . It is also written in this article . Here"s how I write it:

pm2 start --name=ProjectName --env {"NODE_ENV":"Test","PORT":"3000"} ./bin/www

pm2 start --name=ProjectName --env={"NODE_ENV":"Test","PORT":"3000"} ./bin/www    

www  express 
pm2 start --name=ProjectName --env={"NODE_ENV":"Test","PORT":"3000"} node ./bin/www
`node`

the application can be started, but NODE_ENV and PORT are not set successfully. Use process.env to view and do not see these two parameters.
officially provides a way to set env in the configuration file, which is OK. Now I just want to try whether it is possible to directly put it in the command. I wonder if there is something wrong with my writing. Ask for advice.


landlord, is there a problem with understanding? -- env is followed by a string, such as development or production , to specify the environment to get a specific env variable (the JSON environment variable used for declaration) . It is used in conjunction with the defined configuration document .

clipboard.png

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b2c682-33ec0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b2c682-33ec0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?