Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Crawlee + Cheerio Apify Typescript template #2691

Closed
1 task
LouisDeconinck opened this issue Oct 1, 2024 · 2 comments
Closed
1 task

Error Crawlee + Cheerio Apify Typescript template #2691

LouisDeconinck opened this issue Oct 1, 2024 · 2 comments
Labels
bug Something isn't working. t-tooling Issues with this label are in the ownership of the tooling team.

Comments

@LouisDeconinck
Copy link

LouisDeconinck commented Oct 1, 2024

Which package is this bug report for? If unsure which one to select, leave blank

None

Issue description

Using the apify create command and selecting Typescript > Crawlee + Cheerio gets me the following error.

PS C:\Users\name\Documents\apify> apify create
? Name of your new Actor: test4
? Choose the programming language of your new Actor: TypeScript
? Choose a template for your new Actor. Detailed information about the template will be shown in the next step. Crawlee + Cheerio 
? Do you want to install the following template?
 Crawlee + Cheerio:
 A scraper example that uses Cheerio to parse HTML. It's fast, but it can't run the website's JavaScript or pass JS anti-scraping 
challenges. Install template
Run: npm.cmd install --omit=optional
npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated @humanwhocodes/[email protected]: Use @eslint/config-array instead
npm warn deprecated @humanwhocodes/[email protected]: Use @eslint/object-schema instead
npm warn cleanup Failed to remove some directories [
npm warn cleanup   [
npm warn cleanup     'C:\\Users\\name\\Documents\\apify\\test4\\node_modules',
npm warn cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\name\Documents\apify\test4\node_modules\eslint-plugin-react'] {
npm warn cleanup       errno: -4048,
npm warn cleanup       code: 'EPERM',
npm warn cleanup       syscall: 'rmdir',
npm warn cleanup       path: 'C:\\Users\\name\\Documents\\apify\\test4\\node_modules\\eslint-plugin-react'
npm warn cleanup     }
npm warn cleanup   ]
npm warn cleanup ]
npm error code 1
npm error path C:\Users\name\Documents\apify\test4\node_modules\esbuild
npm error command failed
npm error command C:\WINDOWS\system32\cmd.exe /d /s /c node install.js
npm error C:\Users\name\Documents\apify\test4\node_modules\esbuild\install.js:134
npm error     throw new Error(`Expected ${JSON.stringify(versionFromPackageJSON)} but got ${JSON.stringify(stdout)}`);
npm error           ^
npm error
npm error Error: Expected "0.23.1" but got "0.21.5"
npm error     at validateBinaryVersion (C:\Users\name\Documents\apify\test4\node_modules\esbuild\install.js:134:11)
npm error     at C:\Users\name\Documents\apify\test4\node_modules\esbuild\install.js:282:5
npm error
npm error Node.js v20.17.0
npm error A complete log of this run can be found in: C:\Users\name\AppData\Local\npm-cache\_logs\2024-10-01T19_21_37_128Z-debug-0.log
    Error: npm.cmd exited with code 1

If I afterwards try to use apify run I get:

Error: Actor is of an unknown format. Make sure either the 'package.json' file or 'src/__main__.py' file exists or you are in a migrated Scrapy project.

Code sample

No response

Package version

3.5.4

Node.js version

20.17

Operating system

Windows

Apify platform

  • Tick me if you encountered this issue on the Apify platform

I have tested this on the next release

No response

Other context

No response

@LouisDeconinck LouisDeconinck added the bug Something isn't working. label Oct 1, 2024
@github-actions github-actions bot added the t-tooling Issues with this label are in the ownership of the tooling team. label Oct 1, 2024
@LouisDeconinck
Copy link
Author

Tried again today without making any changes and worked without any issues. So, perhaps this is solved? No idea why I got the error in the first place.

@B4nan
Copy link
Member

B4nan commented Oct 2, 2024

Error: Expected "0.23.1" but got "0.21.5"

This is the error that breaks, and it's from esbuild (so most likely from tsx), not from our code. Sounds like you managed to install different versions of esbuild somehow.

Closing, since this is not a problem in the tooling either. And next time please be more patient and don't open issues about the very same thing in multiple places.

@B4nan B4nan closed this as not planned Won't fix, can't repro, duplicate, stale Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working. t-tooling Issues with this label are in the ownership of the tooling team.
Projects
None yet
Development

No branches or pull requests

2 participants