Witam. Mam pewien problem. Otóż pisałem pewien scrypt na laptopie z Windowsem i było wszystko ok - skrypt odpalał jak należy i działał. Gdy przeniosłem wszystkie pliki z GIthuba (włącznie z plikiem package.json i package-lock.json) na inny laptop z Ubuntu, to pojawiły się błędy:
(node:58266) UnhandledPromiseRejectionWarning: Error: Cannot find module 'puppeteer'
Require stack:
- /home/marcin/Pulpit/Projects/gsCChekker/gsCChekker.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1020:15)
at Function.Module._load (internal/modules/cjs/loader.js:890:27)
at Module.require (internal/modules/cjs/loader.js:1080:19)
at require (internal/modules/cjs/helpers.js:72:18)
at gscVerification (/home/marcin/Pulpit/Projects/gsCChekker/gsCChekker.js:2:23)
at Object.<anonymous> (/home/marcin/Pulpit/Projects/gsCChekker/gsCChekker.js:13:11)
at Module._compile (internal/modules/cjs/loader.js:1176:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1196:10)
at Module.load (internal/modules/cjs/loader.js:1040:32)
at Function.Module._load (internal/modules/cjs/loader.js:929:14)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:58266) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:58266) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Tak jak pisałem, zarówno pliki z package.json jak i package-lock.json są identyczne i skopiowane. Dlaczego więc to nie działa po ściągnięciu tego na inny laptop z innym systemem operacyjnym ??