Cross-env MONGO_URL Atlas

Hi I have a MONGO_URL set in cross-env for atlas

This script runs great: ( startdev )

"scripts": {
    "start": "meteor run",
    "startdev": "cross-env MONGO_URL='mongodb+srv://xxxx:xxx@xxxx.xxxx.mongodb.net/xxxx?retryWrites=true'    meteor" 
  },

now I add I add recommended &w=majority to the MONGO_URL and errors:

"scripts": {
    "start": "meteor run",
    "startdev": "cross-env MONGO_URL='mongodb+srv://xxxx:xxx@xxxx.xxxx.mongodb.net/xxxx?retryWrites=true&w=majority'    meteor" 
  },
'w' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1

Thanks heaps

I’m not exactly sure why but this looks as though bash is interpreting the & as a control operator which pushes the cross-env command into the back ground and then tries to run the w command.

escaping the & with a backslash may fix this issue.

"scripts": {
    "start": "meteor run",
    "startdev": "cross-env MONGO_URL='mongodb+srv://xxxx:xxx@xxxx.xxxx.mongodb.net/xxxx?retryWrites=true\&w=majority'    meteor" 
},