Achaak / toogoodtogo-bot

TooGooToGo-Bot is a tool designed to help you stay informed about the availability of your favorite stores on the Too Good To Go platform. It sends notifications, allowing you to quickly find and purchase food products before they disappear.
MIT License
61 stars 17 forks source link

Issue on update/installation #4

Closed Saku241 closed 3 years ago

Saku241 commented 3 years ago

Hello since the 1.1.0 there's a problem while building the project.

first run as readme is saying to run build before install

pi@raspberrypi:~/toogoodtogo-bot $ sudo npm run build
> toogoodtogo-bot@1.1.0 build /home/pi/toogoodtogo-bot
> tsc

sh: 1: tsc: not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! toogoodtogo-bot@1.1.0 build: `tsc`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the toogoodtogo-bot@1.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-01-28T10_33_11_724Z-debug.log

So I tried to run install before run build : pi@raspberrypi:~/toogoodtogo-bot $ sudo npm run build

> toogoodtogo-bot@1.1.0 build /home/pi/toogoodtogo-bot
> tsc

src/core/index.ts:8:20 - error TS2307: Cannot find module './../../config/config' or its corresponding type declarations.

8 import Config from './../../config/config'
                     ~~~~~~~~~~~~~~~~~~~~~~~

src/lib/dataManager/index.ts:2:20 - error TS2307: Cannot find module './../../../config/config' or its corresponding type declarations.

2 import Config from './../../../config/config'
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~

src/lib/telegram/index.ts:1:20 - error TS2307: Cannot find module './../../../config/config' or its corresponding type declarations.

1 import Config from './../../../config/config'
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~

src/services/API/config.ts:2:20 - error TS2307: Cannot find module './../../../config/config' or its corresponding type declarations.

2 import config from "./../../../config/config"
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~

src/services/API/connect.ts:3:20 - error TS2307: Cannot find module './../../../config/config' or its corresponding type declarations.

3 import config from "./../../../config/config"
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~

Found 5 errors.

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! toogoodtogo-bot@1.1.0 build: `tsc`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the toogoodtogo-bot@1.1.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!     /root/.npm/_logs/2021-01-28T10_37_48_388Z-debug.log

Thanks !

Edit : Exact same 5 error codes with Yarn

Achaak commented 3 years ago

Hi !

Indeed, I made a mistake in the order of the steps on the Readme I have just updated it

For your errors, it comes from the fact that you are missing the config.js file.

Saku241 commented 3 years ago

Fixed ! Thank you