When running Meteor Project from Github, it says i'm not in a Meteor project directory

So, I have Meteor version 2.1 installed on my macOS, and I verified it works with the “click me” default meteor app.
I already cloned and pulled this one meteor project to my computer.
But, when I try do cd repo, then ‘meteor run,’ it shows me this error:

run: You’re not in a Meteor project directory.

To create a new Meteor project:
meteor create
For example:
meteor create myapp

So, It still shows me an error when I do run the repository. I tried: meteor install. Then: meteor run. There’s still ^that error.
What should I do?

Show the steps you went through to clone a project. It should be something like:

cd
git clone <some-git-project-repo-uri>
cd <created_repo_dir>

I already did that and cloned the project to my computer. I’m not having issues with cloning or pulling the project. I’m having issues with running the Meteor project. It says: “run: You’re not in a Meteor project directory” even though it’s a Meteor project. Sorry if my question was unclear before

There should be a .meteor folder in the directory where you run the project.

image

NP. Which repo are you trying this with?

The repo i’m trying this with is a person group project I have to do with a team. They’re not facing issues. But I still am unfortunately. And there is a .meteor folder inside the project. Do you know of any workarounds?

Yes, there is a .meteor folder in the project folder. But when I run the project folder, it shows the same error.

Are you using the same OS for development? It shouldn’t make a difference, but if they or you are doing something odd, it may explain it. I regularly switch between Linux, Windows and Windows WSL without issue.

Another check you could try is to clone a repo from Meteor’s GitHub. For example, can you clone and run the simple todos app?

Yes, I am using the same OS for development

I just now tried, and at least it doesn’t give me the same error. However, it says i’m having issues with faker, @babel, and:
While minifying app stylesheet:
internal/modules/cjs/loader.js:982:15: Cannot find module ‘autoprefixer’
Require stack:

So it’s a lot more errors :confused:

I actually tried creating a new react app, moving my repo to that react app, and it would work except, it has a babel package not found error, even though I installed it using the meteor runtime babel path line…

Have you tried meteor npm i --save before running meteor?

Oh my, so the todo app works, thank you so much! But I tried doing that before running my meteor personal group project, then I ran it, and it still says: "run: You’re not in a Meteor project directory.

To create a new Meteor project:
meteor create
For example:
meteor create myapp

For more help, see ‘meteor --help’."

Also, I tried creating another meteor app, and then, I inserted that repo into the folder. And after doing meteor npm i --save, and after running it, it’s giving me this different error: …meteor/local/build/programs/server/boot.js:468
W20210304-00:49:56.406(-6)? (STDERR) }).run();
W20210304-00:49:56.406(-6)? (STDERR) ^
W20210304-00:49:56.406(-6)? (STDERR)
W20210304-00:49:56.406(-6)? (STDERR) Error:
W20210304-00:49:56.407(-6)? (STDERR) The @babel/runtime npm package could not be found in your node_modules
W20210304-00:49:56.407(-6)? (STDERR) directory. Please run the following command to install it:
W20210304-00:49:56.407(-6)? (STDERR)
W20210304-00:49:56.407(-6)? (STDERR) meteor npm install --save @babel/runtime
W20210304-00:49:56.407(-6)? (STDERR)
W20210304-00:49:56.407(-6)? (STDERR) at module (packages/babel-runtime.js:20:9)
W20210304-00:49:56.407(-6)? (STDERR) at fileEvaluate (packages/modules-runtime.js:336:7)
W20210304-00:49:56.408(-6)? (STDERR) at Module.require (packages/modules-runtime.js:238:14)
W20210304-00:49:56.408(-6)? (STDERR) at require (packages/modules-runtime.js:258:21)
W20210304-00:49:56.408(-6)? (STDERR) at packages/babel-runtime.js:53:15
W20210304-00:49:56.408(-6)? (STDERR) at packages/babel-runtime.js:58:3

I tried doing meteor npm install babel, etc, etc., but it ignores it and doesn’t work

I’ve duplicated this error by changing file ownership and permissions. So, for example, if I take a working meteor project and do:

sudo chown root:root .meteor
sudo chmod 700 .meteor

and then run the project:

$ meteor
run: You're not in a Meteor project directory.

To create a new Meteor project:
  meteor create <project name>
For example:
  meteor create myapp

For more help, see 'meteor --help'.

So:

  1. Ensure you installed meteor as your user (not as root).
  2. Check the file ownerships and permissions.
1 Like

So I looked up how to do that, so i did:

dsenableroot
(then typed my passwords)

Then cd repo
meteor

But I still get the same error for some reason.

Because if .meteor was installed in the user, and not the root, then the todos app wouldn’t have opened.

That’s definitely not what you should do!


Here’s a checklist of basics before you start working with meteor:

  1. There is a root user which is enabled.
  2. Your user account can sudo to the root account.
  3. You never use the root account to install meteor.
  4. You never use the root account to run meteor.
  5. You never use the root account to clone meteor git projects.

If you are unsure if you’ve used the root account in a meteor project (3, 4, 5 above), you should remove meteor completely and re-install using your own user account. Ensure you do this before going any further!


Fixing possible ownership issues with pre-existing projects:

  1. cd to the parent directory of your meteor project directories (including git clones).

  2. For each meteor project directory, run chown -R <yourusername>:<yourusername> <projectdirectoryname>. For example, if your username is bob and your meteor project directories are project1 and todos:

    chown -R bob:bob project1
    chown -R bob:bob todos
    
  3. Try going into a project directory and running meteor again.

3 Likes

Thank you! It ended up working after I pasted the full .Meteor file because apparently my project was missing the packages part