Can't create meteor project - meteor

I had a problem where I couldn't create a meteor project using the following command:
cd c:/projects
meteor create foo
I got this error:
You can't create a Meteor project inside another Meteor project.
I found some answers for this problem saying there could me a .meteor folder in the projects folder, but this was not the case.

Turned out there was a .meteor folder in my c:/. After removing this folder the command create worked again.

Related

.NET Core: How to create solution folders from the command line

I am organising a new project, and I would like to create as much of it as possible from the command line.
I like to put my test projects into a solution folder. However, the command dotnet sln add seems somewhat restricted. Its argument list seems to consist only of a list of project files to add.
Is there a way of specifying a solution folder (as opposed to a physical folder) when adding newly created projects (test projects in my case, but the question is more general)?
From this Microsoft Docs
dotnet sln yoursolution.sln add pathofyourproject\yourprojectfile.csproj --solution-folder solutionfoldername
If the solution folder doesn't exist, this command create a new solution folder. In the other cases, this command add a project to your solution folder.
I just accomplished this using .Net Core 2.2 by adding a new project to Tests\UnitTests\UnitTests.csproj folder first, then running the dotnet sln add from the solution root.
Initial Folder Structure
Adding UnitTest.csproj inside Tests\UnitTests
Ran from folder containing TestMvcCore2.sln
dotnet new classlib -o .\Tests\UnitTests -n UnitTests
Adding UnitTest.csproj to TestMvcCore2.sln
Ran from folder containing TestMvcCore2.sln
dotnet sln add .\TestMvcCore2.sln .\Tests\UnitTests\UnitTests.csproj
Creates a Tests solution file in the visual studio sln
At the moment it is not possible, you need create the physical structure folder like the solution structure folders
dotnet new <typeproj> --output "physical/domain" --name "domain"
dotnet new <typeproj> --output "physical/service" --name "service"
after open the solution with visual studio, create the "physical" solution folder and add the previous projects that you already have ready
As mentioned in Microsoft Docs, if you want to create new solution, you have to write dotnet new sln. This command will create a solution file in current directory named with the name of current directory. Also, you can specify the name of output solution file by dotnet new sln -o <SOLUTION_NAME>. This will also create a folder with the name you specify. To add projects to this solution enter in command prompt: dotnet sln <YOUR_SOLUTION_NAME> add <PROJECT_YOU_WANT_TO_ADD> <PROJECT_YOU_WANT_TO_ADD> <PROJECT_YOU_WANT_TO_ADD> ... This will add all the projects you've specified with its folders to the solution you've specified.

Meteor + PhantomJS how to make it work

im trying to install PhantomJS in a MeteorApp.
I have done those step:
Add the npm package
meteor add meteorhacks:npm
Run meteor to let the npm package to pre-initialise
meteor
A file packages.json has been created at the root. Edit it to:
{
"phantomjs": "1.9.13"
}
A this point everything seem to work. But i try to test with this exemple that ive found here :
https://github.com/gadicc/meteor-phantomjs
But i dont understand where to put my phantomDriver.js
Why is phantomDriver.js is in assets/app/phantomDriver.js... but after, they say to create the file in ./private/phantomDriver.js...
Thank for clear explication :)
In development mode you create the file in /private/phantomDriver.js. When you build a meteor app it refactors everything into an application bundle which can be run.
After meteor builds your app it stores stuff from private into assets. For phantomjs to execute this file it needs to look in this directory. You don't have to create it. This is how meteor works internally.
If you look in your .meteor/local/build/programs/server directory the assets directory is there with anything you placed in private.
From the context of where your meteor code runs (the server directory above) the assets directory runs from this directory when your project is running.
Keep in mind when you deploy your app it loses its entire project structure and becomes something else. Gadi's phantomjs project is designed to work in production environments too.
TLDR; Don't worry about the assets directory, keep your file in /private/phantomDriver.js. Meteor should take care of the rest.

Meteor packages folder location

In Meteor documentation I've read that I can test my custom Meteor package locally under one of my Meteor projects by placing the custom package under the /packages folder and entering (meteor add), yet I can't locate the Package folder...I've looked under .meteor folder but can't find any packages folder, the only packages folder I found was under .meteor/local/build/programs/packages so is this the folder where I should place my custom package to test? if now where I can find the packages folder? Thanks
That's because this folder does not exist by default in a Meteor project (just like the client/ or server/ folders).
You need to create this directory at the root of your project, place your custom packages under this directory and meteor add them.

How can I clone / create a copy of my local meteor app?

How can I create a copy of my entire local meteor application? I was expecting a command like "meteor clone myapp" but couldn't find any documentation and simply copying the folder doesn't work.
You could use git to clone the whole thing.
If you aren't familiar with git see this reference. http://gitref.org/creating/
In windows, you can copy and paste the entire project directory and go into .meteor/local directory and delete everything in that directory except the db directory. Then start the meteor server on the new project directory, with everything deleted in the .meteor/local directory, meteor will rebuild the project without altering the logic of your application.

How to tell Meteor to ignore `gulpfile.js`

In my meteor project I want to use gulp for tasks meteor doesn't support.
Anyway, the problem is that gulp uses a file called gulpfile.js which is loaded by meteor too and gives errors. So my question is, is there a way to tell meteor to ignore some files ?
UPDATE: One solution I can think of is to put gulpfile.js in the folder packages or public and run gulp as follows
$> gulp --gulpfile packages/gulpfile.js
UPDATE: Just noticed that meteor also seems to load node_modules files :(
Unfortunately, in the current release there's no way to tell Meteor to leave certain files alone, so you cannot have gulpfile.js in your main app folder.
You can, however, leave it in an ignored subfolder. Meteor ignores files and directories that ends with tilde ~, the /tests directory and all private files (those beginning with a dot .). So you can create a folder named for example gulp~ and use it for your gulp-related stuff.
The same holds for node_modules folder, you cannot have it in your application, and you shouldn't. If you want to use a node package in your Meteor application, you can do this with npm package.
Add it to your project with mrt add npm command.
Then create packages.json file with a list of all required packages, for example:
{
"something": "1.5.0",
"something-else": "0.9.11"
}
Afterwards, include your package with Meteor.require:
var something = Meteor.require('something');
If you want to use a node package in your gulp tasks, install it inside the ignored directory.

Resources