paljs / prisma-tools

Prisma tools to help you generate CRUD system for GraphQL servers
https://paljs.com
MIT License
681 stars 55 forks source link

Error running cli command with npm/yarn #230

Closed bombillazo closed 2 years ago

bombillazo commented 2 years ago

Given a package.json script like "generate:pal": "pal g",

Running it via yarn or npm in Windows gives you the following error:

image

Running it directly on the terminal works as expected.

AhmedElywa commented 2 years ago

The issue is that I don't have a windows device to test on it will try to fix it

bombillazo commented 2 years ago

Hey @AhmedElywa ,I think I know what is happening.

Since the config file for Pal is called pal.js, Yarn is trying to directly run the file instead of calling the pal cli installed.

I think a good convention would be to rename the pal.js config file to something like .palrc.js or pal.config.js to avoid conflict

bombillazo commented 2 years ago

In the meantime I will use pal.json file but I would prefer to have it as a js file eventually.