yammering-amber
yammering-amber2y ago

How to upgrade Crawlee+Playwright to the latest versions?

6 month ago I created a Crawlee+Playwright+"node-beanstalk"(a JS wrapper for Beanstalkd message queue) project. I was following Crawlee documentation, created some... template? and started to add things to this template (no Docker image was used. I just installed things on Ubuntu machine). And somehow it works (and it still wonders me))) This is the versions used at the moment (my package.json is below, feel free to take look/criticize, i know it is not perfect):
crawlee/core 3.3.1
playwright 1.33.0

npm: 8.19.3
node: 16.19.0
crawlee/core 3.3.1
playwright 1.33.0

npm: 8.19.3
node: 16.19.0
Now I see that the latest Crawlee version is 3.5, latest Playwright is 1.39 and may be some other packages are updated. It is time to update. So, what is the proper way to update Crawlee and Playwright in such project? Is it just this:
npm update playwright
npm update crawlee
npm update playwright
npm update crawlee
Or something else? I use headless Firefox it is installed here: ~/.cache/ms-playwright/firefox-1403/ How to update it? Disclaimer: i am not a JS developer, i am Java developer who somehow writes JS code (lot of copy/paste, yes) so I know that dependency management is not that easy, so I think it is better to ask in this forum than create a mess is my project...
4 Replies
yammering-amber
yammering-amberOP2y ago
my package.json:
{
"name": "cr-q-onestep",
"version": "0.0.1",
"type": "module",
"description": "This is an example of a Crawlee project.",
"dependencies": {
"crawlee": "^3.0.0",
"node-beanstalk": "^1.6.8",
"playwright": "*",
"ts-promise": "^2.2.0"
},
"devDependencies": {
"@apify/tsconfig": "^0.1.0",
"ts-node": "^10.8.0",
"typescript": "^4.7.4"
},
"scripts": {
"start": "npm run start:dev",
"start:prod": "node dist/main.js",
"start:dev": "ts-node-esm -T src/main.ts test smartProxyRotatingUS 200 370 2 2",
"build": "tsc",
"test": "echo \"Error: oops, the actor has no tests yet, sad!\" && exit 1"
},
"author": "It's not you it's me",
"license": "ISC"
}
{
"name": "cr-q-onestep",
"version": "0.0.1",
"type": "module",
"description": "This is an example of a Crawlee project.",
"dependencies": {
"crawlee": "^3.0.0",
"node-beanstalk": "^1.6.8",
"playwright": "*",
"ts-promise": "^2.2.0"
},
"devDependencies": {
"@apify/tsconfig": "^0.1.0",
"ts-node": "^10.8.0",
"typescript": "^4.7.4"
},
"scripts": {
"start": "npm run start:dev",
"start:prod": "node dist/main.js",
"start:dev": "ts-node-esm -T src/main.ts test smartProxyRotatingUS 200 370 2 2",
"build": "tsc",
"test": "echo \"Error: oops, the actor has no tests yet, sad!\" && exit 1"
},
"author": "It's not you it's me",
"license": "ISC"
}
other-emerald
other-emerald2y ago
simply type npm i crawlee npm i playwright this will install latest version, you can check it here https://www.npmjs.com/package/crawlee https://www.npmjs.com/package/playwright
npm
crawlee
The scalable web crawling and scraping library for JavaScript/Node.js. Enables development of data extraction and web automation jobs (not only) with headless Chrome and Puppeteer.. Latest version: 3.5.8, last published: 23 days ago. Start using crawlee in your project by running npm i crawlee. There are 26 other projects in the npm registry u...
npm
playwright
A high-level API to automate web browsers. Latest version: 1.39.0, last published: a month ago. Start using playwright in your project by running npm i playwright. There are 617 other projects in the npm registry using playwright.
Lukas Krivka
Lukas Krivka2y ago
In JS, you usually have also package-lock.json which keeps your versions and only upgrades if you force it in package.json. You can do that by setting the minimal version like this:
"crawlee": "^3.5.8",
"crawlee": "^3.5.8",
yammering-amber
yammering-amberOP2y ago
I think these are correct steps: edit package.json npm i crawlee npm i playwright npx playwright install npm run build Without npx playwright install it writes into log:
Looks like Playwright Test or Playwright was just installed or updated. Please run the following command to download new browsers: npx playwright install

Did you find this page helpful?