I will try to summarize my problem here. I have one nodeJS application, that application need to run in node version >14 our <12. When I try to run using node command, it works fine, they use node version 14. But when I try to run with nodemon, the app crashes. I start to using node --version alert and see the nodemon use version 13.
plemos@ubuntu:~/Documents/company-BE$ node index.js
redis.port: 6379
redis.host: localhost
Initiating queue ...
process.env.NODE_ENV: local
process.env.GOOGLE_APPLICATION_CREDENTIALS: /home/plemos/Documents/company-BE/googleKey.json
database: localhost:27017
databaseOption: {"poolSize":5,"useNewUrlParser":true,"useFindAndModify":false,"useCreateIndex":true,"useUnifiedTopology":true,"authSource":"admin","dbName":"company"}
(node:28861) Warning: Accessing non-existent property 'count' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:28861) Warning: Accessing non-existent property 'findOne' of module exports inside circular dependency
(node:28861) Warning: Accessing non-existent property 'remove' of module exports inside circular dependency
(node:28861) Warning: Accessing non-existent property 'updateOne' of module exports inside circular dependency
company BackEnd server start DEV on port 6008!
Versions: {"node":"14.16.0","v8":"8.4.371.19-node.18","uv":"1.40.0","zlib":"1.2.11","brotli":"1.0.9","ares":"1.16.1","modules":"83","nghttp2":"1.41.0","napi":"7","llhttp":"2.1.3","openssl":"1.1.1j","cldr":"37.0","icu":"67.1","tz":"2020a","unicode":"13.0"}
mongodb connection string: localhost:27017/company
connected to mongodb
Run nodemon
nodemon
[nodemon] 2.0.7
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js
[nodemon] starting `node --version; node index.js`
v13.6.0
/home/plemos/Documents/company-BE/node_modules/uuid/dist/esm-browser/index.js:1
export { default as v1 } from './v1.js';
^^^^^^
SyntaxError: Unexpected token 'export'
at wrapSafe (internal/modules/cjs/loader.js:1060:16)
at Module._compile (internal/modules/cjs/loader.js:1108:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1164:10)
at Module.load (internal/modules/cjs/loader.js:993:32)
at Function.Module._load (internal/modules/cjs/loader.js:892:14)
at Module.require (internal/modules/cjs/loader.js:1033:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/home/plemos/Documents/company-BE/src/controllers/bulkImport/doBulkImport.js:26:24)
at Module._compile (internal/modules/cjs/loader.js:1144:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1164:10)
at Module.load (internal/modules/cjs/loader.js:993:32)
at Function.Module._load (internal/modules/cjs/loader.js:892:14)
at Module.require (internal/modules/cjs/loader.js:1033:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/home/plemos/Documents/company-BE/src/routes/bulkImport.js:80:17)
at Module._compile (internal/modules/cjs/loader.js:1144:30)
Any sugestions ?