Closed Vishal-beep136 closed 2 months ago
since there's no pre-compiled libpg-query build for your OS (Windows 11), it tries to compile it on your end using Python. Although, it appears like you don't have Python installed on your machine
To get Python and other build tools installed on Windows, you may want to consider installing Chocolatey
If you did this, you could use the following command to install python
and visualstudio2022-workload-vctools
:
choco install python visualstudio2022-workload-vctools -y
@Vishal-beep136 one thing to consider on Windows is that you may need to use libpg-query
version 16.2.0
, if the U1052: file 'Makefile.msvc' not found
errors from nmake
reported in this issue is still valid:
To get Python and other build tools installed on Windows, you may want to consider installing Chocolatey
If you did this, you could use the following command to install
python
andvisualstudio2022-workload-vctools
:choco install python visualstudio2022-workload-vctools -y
wouldn't it work if I install python manually or from python official site??
Yes, should also work π I just personally avoid downloading programs from websites, as it's slower, more manual work and easier to run into security problems. Using a command line package manager improves all of these things.
Yes, should also work π I just personally avoid downloading programs from websites, as it's slower, more manual work and easier to run into security problems. Using a command line package manager improves all of these things.
@karlhorky Thanks for the response!
Do I also need to install this visualstudio2022-workload-vctools
@karlhorky I used chocolatey to install and it seems that it worked thanks :))
@Newbie012 @karlhorky Btw it would be better if you mention in docs/readme that Python is required at least for windows OS I believe.
Anyway thanks again!!
PRs are welcome π
@Vishal-beep136 if you think that you could do a PR to add the section to the readme + docs, then I would suggest these 2 places:
npm install
code block from the Readme completely and only leave the link to the docs (maybe even remove the Install
section)Prerequisites
section, copied from the docs page, including the docs content and also the new Windows content that you're proposing
If you think that you don't have time for this, maybe you can open a new issue with these as proposals :) Otherwise this will probably be lost in this closed issue.
@karlhorky Well rn I don't have much time but I might consider adding PR if I got free time Otherwise I might create a new issue as you mentioned! or rather should I reopen this issue itself??
New issue is better, please :)
@karlhorky @Newbie012
Heyy I was able to install successfully @ts-safeql/eslint-plugin
libpg-query
without any errors
however it doesn't seems to work, like it's not linting or showing error. I'm using it with Prisma.
I followed this doc prisma
const query = prisma.$queryRaw`SELECT idd FROM users`;
it should display error like -> Error: column "idd" does not exist
I'm not sure what went wrong I believe I've even configured it correct in .eslintrc.js
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: __dirname,
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin', '@ts-safeql/eslint-plugin'],
rules: {
....
'@ts-safeql/check-sql': [
'error',
{
connections: [
{
connectionUrl: process.env.DATABASE_URL,
migrationsDir: './prisma/migrations',
targets: [
{ tag: 'prisma.+($queryRaw|$executeRaw)', transform: '{type}[]' },
],
},
],
},
],
},
}
also EsLint is crashing a lot
[Info - 12:20:26 PM] ESLint server running in node v20.14.0
[Info - 12:20:26 PM] ESLint server is running.
[Info - 12:20:27 PM] ESLint library loaded from: D:\app\backend-nestjs\node_modules\eslint\lib\api.js
migrationPath D:\app\backend-nestjs\prisma\migrations
[Error - 12:20:39 PM] Server process exited with code 3765269347.
[Error - 12:20:39 PM] The ESLint server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
[Info - 12:20:39 PM] ESLint server stopped.
Could be that @ts-safeql/eslint-plugin
libpg-query
aren't compatible with windows OS π ??
or Am I missing something ??
Thanks :)
@Vishal-beep136 we'll take a look and respond here.
In the meantime, if you could take a few minutes to open the new docs issue described above, then we can make sure to not lose the proposed documentation changes π
@karlhorky I'm thinking of doing PR should I change contents in docs/
folder or readme.md
Probably both, check out my comment above
@Vishal-beep136 if the PR is too much, you can also just create an issue for it, documenting the ideas from:
Ah I managed to miss your PR and this issue slipped down my list, I see it now here:
I'll take a look at this and your new issue above today.
@Vishal-beep136 Closing this issue - I've opened a new issue for the Prisma error you reported above:
Describe the bug I can't install using npm by this script
does this library require Python to be installed on the machine??
because I got this error ->
Desktop (please complete the following information):