Meteor: How to bypass update/upgrade - meteor

Is there a way to bypass the auto update feature of Meteor?
I'm stuck with
Downloading meteor-tool#1.3.0_3... \
When I try to run existing project, or create a new one or simply run "meteor list",..It starts updating, downloads meteor-tool#1.3.0_3... which completes 100% and then countdown vanishes & it remains like that with the spindle rotating.
I tried waiting like mentioned at this link
However, nothing happens even after an hour.

I've same error. I resolve by following steps, please try
Download meteor installation from https://github.com/meteor/meteor/wiki/Meteor-on-Windows:-Alternate-installation
Extract zip & Copy all tool from .meteor/packages/meteor-tool directory
Go To %AppData%/../Local/.meteor/packages/meteor-tool or C:\Users\<your_user_name>\AppData\Local\.meteor\packages\meteor-tool
Paste inside folder (Note: If you can't copy or gives error of long path, use RoboCopy)
Now, you can create new Meteor app.

Go to project > .meteor > release
Change the meteor version to the current one that is installed on your system.
Consider my scenario:
1) System have the Meteor version 1.4.3.1 installed
2) Downloaded the todos(meteor project), developed on version 1.4.2.1
3) On running it gives similar problem
4) Changed the release version to 1.4.3.1
5) Run with command 'meteor'

Considering latest Meteor 1.6 you can use below commands for your best needs
meteor create . --release 1.5 --full to create a scaffolded app.
meteor create . --release 1.5 --bare to create an empty app.
NOTE: Instead of --release 1.5 you could use your version which actually exists.

Related

Meteor version is different in local folder from global version

I git clone a package from github and checked the version inside that folder:
>meteor --version
Extracting meteor-tool#1.4.2_7... (forever running)
Then I go outside of that folder:
>meteor --version
Meteor 1.4.3.1
How can I run the global version inside a meteor project folder?
It is because that meteor project you checked out from github is targeting 1.4.2_7. Everytime you create a new meteor project, it saves the version that you used to create it (in a file inside the .meteor folder) so that if the api changes in new future versions, your project will still run (since it targets a specific version in time).
Because of this, when you go to run the project later, it will always use the targeted version (the version used to create the project.). If that version is not on your system, then it will download and install it first before running the app. This is what you have observed. It is downloading that certain version and it can take a very long time to do this depending in your connection speed (it often takes 15 - 25 minutes to do this on my machine at home.
One note, the project's meteor version can be changed by calling meteor update

how do I install a previous version of meteor JS?

I'm trying to host a meteor app that uses an old version of meteor.
Every time i try to start the app it will get somewhat through the process of installing the tool, and then i see a message such as:
Killednloading meteor-tool#1.1.3... -
(note how killed somehow overwrites the downloading part of the command line)
Is there a reliable way to install the meteor tool at a specific version?
EDIT:
The Meteor team added a release parameter to their download endpoint. Now you can simply specify the desired version:
curl "https://install.meteor.com/?release=1.3.3.1" | sh
For Windows, a version parameter exists for the choco installer:
choco install meteor --version 1.3.3.1
Original solution
You can use sed for that. Insert it in the middle of curl and sh:
curl https://install.meteor.com/ | sed 's/1.4/1.3.3.1/' | sh
That will replace the release 1.4 (current version) to 1.3.3.1
When you create a meteor app you can specify a release:
meteor create test --release x.y.z
And when you update a meteor app you can do the same:
meteor update --release x.y.z
#Jorge Issa's answer is good if you are installing Meteor from scratch, on a system that never had Meteor installed, however it's subject to change since versions change all the time, so you need to adapt the sed line.
If you have any version of Meteor already installed, as Michel Floyd mentioned, you can always create a project with a specific version by adding the --release flag.
meteor update --release xxxx works fine with you're actually upgrading, but downgrading is a different story.
My recommendation when it comes to upgrading and eventually downgrading, is to use version control (git).
Attempt upgrade and if all is fine, you're in good shape, if not and you want to downgrade, simply clear the file changes in your version control system and use meteor reset to clean your project and rebuild with the previous version.
!Note! meteor reset clears the local mongo database too, so be sure to back that up first if you're going to do that (check mongodump and mongorestore for that)
finally, if you're looking to clean up the clutter from the .meteor folder, you can delete the folder and then run meteor reset in your project: the meteor executable will detect you don't have the needed packages will re-download the packages for the version needed by your project. (This takes a while and if you have many project, can be cumbersome as you need to do this in each project, but if like me you are looking to clear some space, this works fine.)
Try:
meteor update --release x.y.z
Try
choco install meteor --x86 --params="'/RELEASE:1.5.4.4'"

Creating a .NET secret using SecretManager

I'm working with Visual Studio 2015 RC and following a tutorial for adding Facebook auth. It says to store the Facebook App Id as a secret using the SecretManager app:
"Set the Facebook AppId by running user-secret set Authentication:Facebook:AppId 862373430475128"
I am not quite grasping how to install the SecretManager, or how to access it from a command line. I'm used to VS2010 and so the dnvm/dnu stuff is totally new to me. Here's what I've tried:
opened a regular command prompt and typed dnvm - that works; it's in the PATH
typed user-secret - not recognized
tried to install SecretManager via dnvm - got an error partway through
added SecretManager to my project via nuGet - worked but I don't get where to go to type "user-secret"
Can someone provide a simple set of steps to get to where I can use the "user-secret" command?
UPDATE: After manually adding the dnu tool to my Path and running
dnu commands install SecretManager
I got the following command line output:
GET https://www.nuget.org/api/v2/FindPackagesById()?Id='SecretManager'.
OK https://www.nuget.org/api/v2/FindPackagesById()?Id='SecretManager' 595ms
Restoring packages for C:\Users\jprice\.dnx\bin\packages\6534b338f1b44210898ea19d5c3801b9\project.json
Writing lock file C:\Users\jprice\.dnx\bin\packages\6534b338f1b44210898ea19d5c3801b9\project.lock.json
Restore complete, 358ms elapsed
Restoring packages for C:\Users\jprice\.dnx\bin\packages\SecretManager\1.0.0-beta4\app\project.json
CACHE https://www.nuget.org/api/v2/FindPackagesById()?Id='SecretManager'
GET https://www.nuget.org/api/v2/FindPackagesById()?Id='System.Console'.
OK https://www.nuget.org/api/v2/FindPackagesById()?Id='System.Console' 407ms
Unable to locate SecretManager >= 1.0.0-beta4-10173
Writing lock file C:\Users\jprice\.dnx\bin\packages\SecretManager\1.0.0-beta4\app\project.lock.json
Restore complete, 564ms elapsed
Errors in C:\Users\jprice\.dnx\bin\packages\SecretManager\1.0.0-beta4\app\project.json
Unable to locate SecretManager >= 1.0.0-beta4-10173
I know how to install nuGet packages for a specific app, but I'm less clear on how the global tools concept works. I'm currently on VS 2010, so this is mostly new to me.
See https://github.com/aspnet/Home/issues/601 . A user there had the same issue with SecretManager and his solution (editing the dependency version at C:\Users\myname.dnx\bin\packages\SecretManager\1.0.0-beta4\app) worked for me.
I'm still not 100% clear on why I had to manually set up the PATH to the dnu tool, but I'm guessing that the community edition is just missing the VS command prompt and other items.

Can I undo updating Meteor?

I think updating Meteor might have broken my app. It was working, then I ran meteor update, and now it is not working. Can I do something like meteor downgrade?
Meteor 0.6.0 and above ships with a new distribution system. You can now pass the --release argument to any Meteor command and it will run against the requested release. For example, to bundle your app against Meteor 0.6.1, run: meteor bundle --release 0.6.1. Notably, this only works for post-0.6.0 releases.
If you want to pin your app to a specific release, run: meteor update --release <release>. This modifies the .meteor/release file in your app directory. Then simply run Meteor as usual. You'll still get notified when there's a new release available.
UPDATE: As of Meteor 0.6.0, this functionality is available without using Meteorite. See Avital's answer. (for versions > 0.6.0. To use functionality on versions less than 0.6.0 you can still use Meteorite:
If you want to control versions with your apps (so your existing app can still use an older version, or 0.57.1 (with the security bug fix) you can use meteorite: https://github.com/oortcloud/meteorite
Install it via npm install -g meteorite
Its also helpful with loads of other packages from http://atmosphere.meteor.com.
To control the version of your app edit your smart.json to something with:
{
"meteor": {
"tag": "v0.5.7"
}
}
Only the app you've already made will be affected & you can upgrade it when you're ready.
I have tried this and it is very hard. My best advice is to try and copy all the files from an app running the version you want, then paste your app's code in there.
There is no meteor downgrade command from its CLI. The best and easy way if you have version control like GIT, just undo your recent changes by git stash save, and run meteor again.
On Windows, I was able to effectively "downgrade" from a failed upgrade by editing the version number to a previous working release in the file:
C:\Users\Paul\AppData\Local.meteor\meteor.bat
You need to change it to a version which has a corresponding folder in: .meteor\packages\meteor-tool

How do you run the meteor tests?

I made some changes to livedata and would like to run the livedata_test. How do you use tinytest to run the livedata_test?
After doing some digging, I've figured out that you may run meteor from the packages directory of your cloned meteor source.
Source: SFJS #23: Functional Programming and Meteor.js (this is actually a fantastic video in general).
Switch to ... /meteor/packages/
Run meteor
Navigate to http://0.0.0.0:3000/ in the browser.
Tests for individual packages may be run by navigating to the specific package directory and following steps 2 and 3 above.
Presto:
Might be worth nothing that you need to make sure you are running the dev "meteor" script from your working git directory. Simply running meteor will default to the system meteor in your path (if you have meteor installed) and will not pick up any changes to the tests / core code that you make.
Run meteor test-packages, then point your browser at http://localhost:3000 .
Run meteor from in the directory of the package you want to test and view results in browser.
Velocity had been selected as the official testing framework for meteor 1.0. The announcement has been made in the last meteor devshop (june 2014).
Packages developed with velocity:
velocity (the test runner)
jasmine-unit (jasmine syntax)
mocha-web-velocity (for testing collections)
velocity-html-reporter (view the tests in the browser)
git clone git://github.com/meteor/meteor.git
cd meteor
./meteor test-packages <package>
Then navigate to http://localhost:3000/.
You have to pass it a driver package. This is how I ran them:
meteor test --driver-package practicalmeteor:mocha
Then check out the app and you should see a UI with the test results.

Resources