After installing puppeteer via npm, I encountered errors when trying to compile it:
This dependency was not found:
* ws in ./node_modules/puppeteer/lib/WebSocketTransport.js
To resolve this, you can run: npm install --save ws
These relative modules were not found:
* ./types/other in ./node_modules/puppeteer/node_modules/mime/index.js
* ./types/standard in ./node_modules/puppeteer/node_modules/mime/index.js
Regarding ws
: I attempted to reinstall ws using npm install --save ws
, but the issue persisted.
As for ./types/other
and .types/standard
, I tried modifying the file
node_modules/puppeteer/node_modules/mime/index.js
by adding .json
at the end of the filename in require. Admittedly, altering files in the vendor folder is not the correct approach, but I'm unsure how to rectify this properly.
I explored solutions provided here: https://github.com/GoogleChrome/puppeteer/issues/2754#issuecomment-403321142
Despite my efforts, the issue persists, leading me to question if I have grasped the solution correctly.
Here is a snippet from my package.json:
{
"jest": {
"moduleFileExtensions": [
"json",
"vue",
"js"
]
},
"private": true,
"scripts": {
...
},
"devDependencies": {
"axios": "^0.17",
"bootstrap": "^4.1.3",
"cross-env": "^5.2.0",
"jquery": "^3.2",
"laravel-mix": "^2.1.14",
"lodash": "^4.17.11",
"popper.js": "^1.14.4",
"postcss-css-variables": "^0.9.0",
"vue": "^2.5.17"
},
"dependencies": {
"ajv": "^6.0.0",
"imagemin": "^5.0.0",
"npm": "^5.10.0",
"puppeteer": "^1.14.0",
"ws": "^6.2.1"
}
}
The inclusion of jest
in my dependencies seems odd as I do not have jest installed. I am now uncertain about how to address this issue.