-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Packages fail to install #65
Comments
Can confirm, does the same for me. |
is the constant PKG_ROOT accurate? it seems to be failing to copy over the base app when it scaffolds the project. not when it is installing the packages EDIT: latest version on main branch (4.2.8) seems to work for me: |
Thats interesting, works for you but not for me |
I also have no issues running the CLI directly from npm store: https://app.warp.dev/block/H3HrXKP4E2yQtnfzflNLzd EDIT: nvm running it when I'm not in the package directory fails: https://app.warp.dev/block/TapKvjoErC2CPtQlGHHhSV. even more reason to think the PKG_ROOT path is inaccurate |
One very hacky solution: (seems to work for me, needs more testing) import path from "path";
import { fileURLToPath } from "url";
import { dirname } from "path";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
// With the move to TSUP as a build tool, this keeps path routes in other files (installers, loaders, etc) in check more easily.
// Path is in relation to a single index.js file inside ./dist
export const PKG_ROOT = path.join(__dirname, "../"); |
how are you getting the error when running the build locally? |
Yes, the |
should the template folder not ship with the CLI so that you don't have to do this hack and keep the paths as before? |
Well, I don't really see how we can avoid shipping the template folder since those files need to be copied during scaffold and install. |
If you want to try to reproduce the error locally, you can install the package globally on your local machine and the try running |
i don't have much knowledge about how shipping packages works, but in the |
I'm not too experienced either, but here's the npm reference for which files get included: https://docs.npmjs.com/cli/v8/commands/npm-publish#files-included-in-package |
Here's a summary of the problem as I understand it: // The directory you are running npx create-t3-app in:
some/dir/
// The directory pointed to by the current version of PKG_ROOT:
some/
// The directory that the scaffolding step will look for:
some/template/base Instead, we want the PKG_ROOT to point at the dirname of the package itself. |
I believe that Kevins solution is good enough, and I can't seem to find any other way to get the path of the package itself. Got a PR ready if you want me to submit it since Kevin logged off. Have tested it and it seems reliable |
If you need confirmation of this being an issue, I just tried to use it and had the same issue as @nexxeln |
Thank you for confirming |
Describe the bug
After selecting packages to install it fails and shows this error
To Reproduce
Steps to reproduce the behavior:
npx create-t3-app@latest
Expected behavior
Packages should be installed
Screenshots
The text was updated successfully, but these errors were encountered: