I have a friend who has created a bot for some Amazon ads through Telegram and I have followed all his instructions, but when I run the bot it tells me this and it can’t be fixed. Any ideas? thank you
root@DietPi:/mnt/USB/VineMonitoringBot# node vineScrapper.js
internal/modules/cjs/loader.js:818
throw err;
^
Error: Cannot find module 'fs/promises'
Require stack:
- /mnt/USB/VineMonitoringBot/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserFetcher.js
- /mnt/USB/VineMonitoringBot/node_modules/puppeteer-core/lib/cjs/puppeteer/node/node.js
- /mnt/USB/VineMonitoringBot/node_modules/puppeteer-core/lib/cjs/puppeteer/puppeteer-core.js
- /mnt/USB/VineMonitoringBot/vineScrapper.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
at Function.Module._load (internal/modules/cjs/loader.js:667:27)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/mnt/USB/VineMonitoringBot/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserFetcher.js:59:20)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/mnt/USB/VineMonitoringBot/node_modules/puppeteer-core/lib/cjs/puppeteer/node/node.js:32:14)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/mnt/USB/VineMonitoringBot/node_modules/puppeteer-core/lib/cjs/puppeteer/puppeteer-core.js:35:14)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/mnt/USB/VineMonitoringBot/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserFetcher.js',
'/mnt/USB/VineMonitoringBot/node_modules/puppeteer-core/lib/cjs/puppeteer/node/node.js',
'/mnt/USB/VineMonitoringBot/node_modules/puppeteer-core/lib/cjs/puppeteer/puppeteer-core.js',
'/mnt/USB/VineMonitoringBot/vineScrapper.js'
Sorry, but as I said I’m pretty new to these issues and I don’t know exactly what you want to tell me. Another thing, npm is now giving me another error and I don’t know why…
ERROR: npm v9.6.2 is known not to run on Node.js v12.22.12. You'll need to
upgrade to a newer Node.js version in order to use this version of npm. This
version of npm supports the following node versions: `^14.17.0 || ^16.13.0 ||
>=18.0.0`. You can find the latest version at https://nodejs.org/.
ERROR:
/usr/local/lib/node_modules/npm/lib/utils/exit-handler.js:21
const hasLoadedNpm = npm?.config.loaded
^
SyntaxError: Unexpected token '.'
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at module.exports (/usr/local/lib/node_modules/npm/lib/cli.js:81:23)
at Object.<anonymous> (/usr/local/lib/node_modules/npm/bin/npm-cli.js:2:25)
at Module._compile (internal/modules/cjs/loader.js:999:30)
Not directly from the installation, it comes from apt-get -y -eany update and you have some ubuntu sources in your sources list, which make trouble. Did you add them by yourself?
/etc/apt/sources.list:
deb https://deb.debian.org/debian/ bullseye main contrib non-free
deb https://deb.debian.org/debian/ bullseye-updates main contrib non-free
deb https://deb.debian.org/debian-security/ bullseye-security main contrib non-free
deb https://deb.debian.org/debian/ bullseye-backports main contrib non-free
/etc/apt/sources.list.d/focal-security.list:
deb http://security.ubuntu.com/ubuntu focal-security main
/etc/apt/sources.list.d/raspi.list:
deb https://archive.raspberrypi.org/debian/ bullseye main