-
-
Notifications
You must be signed in to change notification settings - Fork 360
chore: remove yarn and only use npm #461
chore: remove yarn and only use npm #461
Conversation
@paulywill @pdotsani @paizle this PR looks to remove Yarn and use only npm. You were involved in yarn issues / conversations on #402 and #447 so I though you might want to give a look too. |
Since you're developing on Windows, @paizle, it would be great if you could confirm I've not broken the commands. |
I will definitely have have a look. |
Ok, I checked this out and the docker method works (docker-compose up). I tried the manual way and ran into some issues but I was able to fix them on my side. In packackage.json:
With escaped double quotes:
and I was able to run the app with "npm run both". I'm still not sure on exactly why "npm run db:reset" or the other db commands don't work on my platform: Error output from running "npm run db:reset":
\Chapter\node_modules.bin\typeorm:2 SyntaxError: missing ) after argument list I've run into this problem before on my Git Bash for Windows platform and solved it by replacing the line in package.json:
to
I don't expect this to impact other platforms (though I could be wrong). I researched it months ago. I'll paste my modified package.json here:
|
@paizle thanks for going through all this. Just to confirm: was |
No, the DB commands did not work. The only thing I did to get them to work was changing: "typeorm": "ts-node -P tsconfig.server.json ./node_modules/.bin/typeorm", to "typeorm": "ts-node -P tsconfig.server.json ./node_modules/typeorm/cli.js", In package.json. |
@paizle 's issue seems to be related to Git Bash + Windows and probably because there's a symlink involved. @ojeytonwilliams do we think using the literal path instead of a symlink is likely to fix one environment and break others? If so, perhaps we break that into a new issue. I found some chat about the escaping of characters being an issue / bug with Git Bash on Windows so symlink and/or escaping seems like they could the what's breaking Git Bash. |
Or, @paizle have you checked if enabling symlinks will work in Git Bash? |
This rings a bell from when I was looking into it before. I will check it out. |
Windows doesn't natively support symlinks, so it's rather likely this could fix Git Bash. If so, we can document the exception for Git Bash because changing the typeorm path is likely to cause issues for some other environment or configuration. |
@allella ah, that makes a lot of sense. And, yes, let's handle this in a separate issue. I'll create one to track this and revert the last commit. |
@ojeytonwilliams I did a ton of big and small changes to the CONTRIBUTING.md in #466 and I suspect that will leave us with a gnarly merge conflict when things are merge. Not sure the best way to do it with the two open PRs, but wanted to give a heads up. The Git Bash issues mentioned above and further in #465 don't seem to be specific to npm vs yarn, so I think we can ignore that as a concern. CONTRIBUTING.md provides notes on requiring / installing Node.js, so that means we know everyone will have npm by default. Moving everything to npm will at least avoid "yarn not installed" errors. If it turns out there was a good reason to use yarn for some, or all of the things, we can always just reverse things. You good with proceeding? |
Thanks for the heads up and yeah, I'm fine with proceeding. Just give me a shout if you merge either one - I'd be happy to fix any conflicts. |
… on CONTRIBUTING.md
@ojeytonwilliams #466 did a find and replace on yarn to npm. If you revert your CONTRIBUTING.md changes in this PR, then I think we're ready to commit it. Thanks |
Actually, a straight search and replace doesn't quite work, since |
Co-authored-by: paizle <44871665+paizle@users.noreply.github.com>
This reverts commit 22bf12c.
52e891e
to
df652e6
Compare
@allella all done, should be good to go now. |
Update README.md
).master
branch of Chapter.Closes #459
Before this PR, npm was used to install packages both in manual development and when using Docker, but yarn was used for scripts. I've removed yarn entirely and re-written the scripts to use
npm run
instead ofyarn
.The objective is just to simplify development by only relying on a single package manager.