The project is written on Node.js v18.11 with all the necessary dependencies installed in the package.json file, there is a wrangler.toml file in the root of this project.
The project uses the npm “Imap-simple” module.
When I type the “wrangler deploy” command in the terminal, I get an error:
⛅️ wrangler 3.1.2
------------------
Total Upload: 2309.32 KiB / gzip: 610.66 KiB
X [ERROR] A request to the Cloudflare API (/accounts/101010101001010101010010101010101abc/workers/scripts/parsit) failed.
Uncaught TypeError: Invalid Version:
at worker.js:4918:17 in SemVer
at worker.js:5128:16 in compare5
at worker.js:5168:16 in gte
at worker.js:5629:18 in node_modules/utf7/utf7.js
at worker.js:13:52 in __require
at worker.js:11282:18 in node_modules/imap/lib/Connection.js
at worker.js:13:52 in __require
at worker.js:16840:18 in node_modules/imap-simple/lib/imapSimple.js
at worker.js:13:52 in __require
at worker.js:17261:24 in node_modules/imap-simple/index.js
[code: 10021]
// My wrangler.toml file
name = "app"
main = "src/main.ts"
tsconfig = "tsconfig.json"
account_id = "12123216321632163721636217361"
node_compat = true
compatibility_date = "2023-06-24"
workers_dev = false
[triggers]
crons = [ "55 */2 * * *" ] # * * * * * = run every minute
// My package.json file
{
"name": "app",
"version": "0.0.1",
"description": "",
"author": "",
"private": true,
"license": "UNLICENSED",
"node": "18.11.0",
"scripts": {
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "nest start",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json"
},
"dependencies": {
"@nestjs/common": "^9.0.0",
"@nestjs/core": "^9.0.0",
"@nestjs/platform-express": "^9.0.0",
"@types/imapflow": "^1.0.11",
"@types/mailparser": "^3.4.0",
"@types/xlsx": "^0.0.35",
"imap-simple": "^5.1.0",
"langchain": "^0.0.84",
"mailparser": "^3.6.3",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.2.0",
"xlsx": "https://cdn.sheetjs.com/xlsx-0.19.2/xlsx-0.19.2.tgz"
},
"devDependencies": {
"@nestjs/cli": "^9.0.0",
"@nestjs/schematics": "^9.0.0",
"@nestjs/testing": "^9.0.0",
"@types/express": "^4.17.13",
"@types/jest": "29.2.4",
"@types/node": "18.11.18",
"@types/supertest": "^2.0.11",
"@typescript-eslint/eslint-plugin": "^5.0.0",
"@typescript-eslint/parser": "^5.0.0",
"eslint": "^8.0.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"jest": "29.3.1",
"prettier": "^2.3.2",
"source-map-support": "^0.5.20",
"supertest": "^6.1.3",
"ts-jest": "29.0.3",
"ts-loader": "^9.2.3",
"ts-node": "^10.0.0",
"tsconfig-paths": "4.1.1",
"typescript": "^4.7.4"
}
}