canove / whaticket-community

A very simple Ticket System based on WhatsApp messages, that allow multi-users in same WhatsApp account.
MIT License
1.67k stars 841 forks source link

Error appears after running npm run build #641

Closed ras-24 closed 4 months ago

ras-24 commented 4 months ago

An error appears during the initial installation at the npm run build stage. I use Windows 10 PC with Nodejs v14.21.3

Steps I do :

  1. git clone https://github.com/canove/whaticket-community.git
  2. cd whaticket-community\backend
  3. copy .env.example .env
  4. Modify .env file like below :
    
    NODE_ENV=
    BACKEND_URL=http://localhost
    FRONTEND_URL=http://localhost:3000
    PROXY_PORT=8080
    PORT=8080

DB_DIALECT= DB_HOST=localhost DB_USER=root DB_PASS= DB_NAME=whaticket

JWT_SECRET=54616516516516851751651 JWT_REFRESH_SECRET=56126168175165161564165

5. npm install
6. npm run build
After running `npm run build` i got error below :

E:\Programming\Javascript\whaticket-community\backend>npm run build

backend@1.0.0 build E:\Programming\Javascript\whaticket-community\backend tsc

node_modules/@types/lodash/common/object.d.ts:1026:46 - error TS1005: '?' expected. 1026 : K extends ${infer N extends number} ? T[N] ~ node_modules/@types/lodash/common/object.d.ts:1031:46 - error TS1005: '?' expected. 1031 : K extends ${infer N extends number} ? T[N] ~ node_modules/@types/lodash/common/object.d.ts:1041:46 - error TS1005: '?' expected. 1041 : K extends ${infer N extends number} ~ Found 3 errors.

npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! backend@1.0.0 build: tsc npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the backend@1.0.0 build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\ras\AppData\Roaming\npm-cache_logs\2024-06-27T22_47_56_412Z-debug.log



How to fix this error?
jeangiordani commented 4 months ago

looks like it doesnt support the typescript version on package.json anymore. https://github.com/DefinitelyTyped/DefinitelyTyped/issues/69932

ras-24 commented 4 months ago

looks like it doesnt support the typescript version on package.json anymore. DefinitelyTyped/DefinitelyTyped#69932

Getting back to previous version solved for me

AleCadz commented 4 months ago

How can i back to previous version?

jeangiordani commented 4 months ago

How can i back to previous version?

In my case, i solved it by bumping typescript version to "typescript": "4.7.3" in the package.json file