I installed puppeteer using npm, then when tried to compile it, there are errors:
This dependency was not found:
* ws in ./node_modules/puppeteer/lib/WebSocketTransport.js
To install it, 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
About ws
: I tried to install ws again using npm install --save ws
but still the same.
About ./types/other
and .types/standard
, I tried to edit the file node_modules/puppeteer/node_modules/mime/index.js
and added .json
at the end of file name in require. I know it is not correct to edit file from vendor folder, but I don't know how to fix it in correct way.
I tried solutions from here: https://github.com/GoogleChrome/puppeteer/issues/2754#issuecomment-403321142
But still no luck, or I don't know if I understand it correctly.
Here is 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"
}
}
I think adding jest
there doesn't make sense since I don't have jest installed, But I don't know now how to fix it.