I am getting the following error when executing the playAudit() function after installing playwright-lighthouse library.
The error is as follows:
node:internal/errors:490
ErrorCaptureStackTrace(err);
^
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'lighthouse' imported from /Users/ankur/playwright_test_suite/node_modules/playwright-lighthouse/src/task.js
at new NodeError (node:internal/errors:399:5)
at packageResolve (node:internal/modules/esm/resolve:889:9)
at moduleResolve (node:internal/modules/esm/resolve:938:20)
at defaultResolve (node:internal/modules/esm/resolve:1153:11)
at nextResolve (node:internal/modules/esm/loader:163:28)
at ESMLoader.resolve (node:internal/modules/esm/loader:838:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:77:40)
at link (node:internal/modules/esm/module_job:76:36) {
code: 'ERR_MODULE_NOT_FOUND'
}
Cause for this: The lighthouse library has been added in playwright-lighthouse as a devDependency. In a node project, the dev-dependencies of a dependency aren't installed. This, this error is shows everytime and users need to explicitly install lighthouse in the project.
I am getting the following error when executing the
playAudit()
function after installingplaywright-lighthouse
library. The error is as follows:Cause for this: The
lighthouse
library has been added inplaywright-lighthouse
as a devDependency. In a node project, the dev-dependencies of a dependency aren't installed. This, this error is shows everytime and users need to explicitly installlighthouse
in the project.