oortcloud/meteorite

Unable to make meteorite work (Installing Meteor issue?)

tjoyal opened this issue · 34 comments

Sorry about that but I haven't found any other references to my problem (and I looked a lot)

Before trying meteorite, I already had meteor installed (dont know it it might change anything)

I installed meteorite:

> sudo npm -g install meteorite

I used sudo as it would not install otherwise ("npm ERR! Error: EACCES, permission denied '../lib/node_modules/meteorite/bin/mrt.js'")

Then I run it

> mrt run

Stand back while Meteorite does it's thing

Installing Meteor

  branch: https://github.com/meteor/meteor.git#master

Installing smart packages


node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
Error: ENOENT, no such file or directory '/home/ubuntu/.meteorite/meteors/meteor/meteor/067113a37dd4e7824db1a16d5f7a90c3739eed9c'
    at Object.mkdirSync (fs.js:373:18)
    at Object.mkdirSyncRecursive (/usr/local/lib/node_modules/meteorite/node_modules/wrench/lib/wrench.js:361:12)
    at [object Object]._load (/usr/local/lib/node_modules/meteorite/lib/sources/git.js:125:12)
    at /usr/local/lib/node_modules/meteorite/lib/sources/git.js:73:18
    at /usr/local/lib/node_modules/meteorite/lib/sources/git.js:89:5
    at /usr/local/lib/node_modules/meteorite/lib/sources/git.js:216:5
    at ChildProcess.exithandler (child_process.js:280:7)
    at ChildProcess.emit (events.js:70:17)
    at maybeExit (child_process.js:360:16)
    at Socket.<anonymous> (child_process.js:457:7)

But "/home/ubuntu/.meteorite/meteors" simply not exist.

I guess meteo was never downloaded.

Can anyone point me in a direction?

This seems be a problem with node creating directories in the ubuntu in virtualbox in W7 setup. Not sure what the reason is.

capi commented

I see the same problem on a Ubuntu 12.04 installation inside VirtualBox.

Using mkdir -p /home/martin/.meteorite/meteors/meteor/meteor/ got me one step further, but failed again later. Performing also mkdir -p /home/martin/.meteor/meteorite/packages got it working.

Ok, well I don't have a windows machine or really any ideas on why this might be happening. If you guys find out what the deal is (it's either node or wrench) can you please report back!

Thanks for the info @capi

capi commented

Well, its only working partially. The project creation worked, but the execution then fails:

martin@host:~/meteor$ mrt create testproject

Installing Meteor

  branch: https://github.com/meteor/meteor.git#master

Installing smart packages

testproject: created.

To run your new app:
   cd testproject
   meteor
martin@host:~/meteor$ cd testproject/
martin@host:~/meteor/testproject$ mrt

Stand back while Meteorite does it's thing

Installing Meteor

  branch: https://github.com/meteor/meteor.git#master

Installing smart packages

Adding meteorite to .meteor/gitignore

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
Error: ENOENT, no such file or directory '/home/martin/meteor/testproject/.meteor/meteorite/packages'
    at Object.mkdirSync (fs.js:373:18)
    at Object.mkdirSyncRecursive (/usr/local/lib/node_modules/meteorite/node_modules/wrench/lib/wrench.js:361:12)
    at /usr/local/lib/node_modules/meteorite/lib/project.js:137:12
    at /usr/local/lib/node_modules/meteorite/lib/project.js:109:9
    at /usr/local/lib/node_modules/meteorite/lib/dependencies/resolver.js:47:5
    at [object Object].resolveStep (/usr/local/lib/node_modules/meteorite/lib/dependencies/resolver.js:57:12)
    at [object Object].resolve (/usr/local/lib/node_modules/meteorite/lib/dependencies/resolver.js:43:8)
    at Function.resolve (/usr/local/lib/node_modules/meteorite/lib/dependencies/resolver.js:144:33)
    at [object Object].resolve (/usr/local/lib/node_modules/meteorite/lib/dependencies/dependencies.js:99:12)
    at /usr/local/lib/node_modules/meteorite/lib/project.js:97:25``

What I find strange is that there is no .meteorite subdirectory in .meteor of the project. I think, node is not creating any directories, even though mkdirp is installed. (I am completely new to nodejs, so this may be completely nonsense.)

No, that's exactly it. For some reason node isn't able to create directories. If one of you guys would like to create a simple node script that uses wrench to create some directories, you might be able to figure out if it's a bug in wrench or in node itself (or in meteorite somehow).

Ok, I have been working on this for a while with @tmeasday on irc, so it really seems to be an issue with creating nested directories.

Let's say It was trying to install

/home/ubuntu/.meteorite/packages/moment/possibilities/meteor-moment/c64b6ec0e714b9556f4b6643d430b868ba69d3d7

via a smart.json

{
    "meteor": {
        "branch": "master",
        "git": "http://github.com/meteor/meteor.git"
    },

    "packages": {
        "moment": "1.7.0"
    }
}

It sayd the install was successful but the code was not created.

Had to do

mkdir -p /home/ubuntu/.meteorite/packages/moment/possibilities/meteor-moment
mrt run

And it worked.

Still don't know why. Might be my computer setup (running ubuntu 12.4 in a vbox on windows 7).

capi commented

Do you really think that the Ubuntu 12.04 running inside VirtualBox has got anything to do with it (the VirtualBox part, not the Ubuntu part)? Because I can hardly imaging anything below the Ubuntu 12.04 layer to be responsible for node.js not being able to make recursive directories. My first guess as a absolute newbie to node is, that it would have to do something with the node-mkdirp package of 12.04 (my version being 0.3.1-2)?

Well, a lot of people have used meteorite on various flavours of ubuntu, and you two both are running into the problem on ubuntu in virtualbox, so I would say, yes, it is the problem. I literally just installed meteorite on an amazon ubuntu 12.04 instance without incident.

capi commented

Well, it's a rather strange issue for me (really not being able to think about a reason where VBox could interfere here), so I hope I might find a second to try it tomorrow at work on a physical box.

I agree that it doesn't really make sense when you think about it. I look forward to hearing more.

Using

locate node | grep -e "node$"

Reveal that I have 2 nodes installed

which node => /usr/bin/node
/usr/bin/node -v => v0.6.12
/usr/lib/meteor/bin/node -v => v0.8.11

capi commented

I only have /usr/bin/node, which is the 0.6.12 version, which ships with Ubuntu 12.04 at the moment. I don't have /usr/lib/meteor installed on the system anymore, I de-installed the .deb file so that I could work in a clean environment with meteorite.

Success! (I think...)

~/.bashrc

METEOR_HOME="/usr/lib/meteor"
PATH=$METEOR_HOME/bin:$PATH

And then

rm -rf ~/.meteorite
mrt run

No errors so far...

So that would be 100% OS setup related

capi commented

Ah, this looks promising, I will try this tomorrow. Need to install at least one copy of Meteor then again :) Thanks for the hint!

Oh, interesting. Ok, that sounds like a much more sensible explanation!

I was following these instructions which installs node 0.8, so that could explain why it works on my ubuntu instances.

As far as I know meteorite works with node 0.6, although maybe it was a higher version than 0.6.12. @possibilities care to weigh in here?

capi commented

Using the ppa with the newer node.js version, it works. So it seems a pure compatibility version with the node.js version that ships with Ubuntu 12.04 LTS. I'd really find it good if the latest LTS was supported, but this is of course up to the developers. :-)

I can confirm that this problem still exists and that the workaround works.
https://gist.github.com/4530915

Same story here on Ubuntu 12.04 (no VM/VB). The solution posted by @tjoyal solved my problem. Thanks :D

I'm not sure what to do with this one. I am not seeing any problems with node 0.6.12 on my OS X machine.

Is there a known bug with 0.6.12 + linux? It's probably not a big deal to tell people they have to use node 0.8, but I'd prefer not to have to if we can figure out why this is happening..

I was having the exact same issue with Ubuntu on Virtualbox. dirkk0's link solved the problem for me.

Ok, well I'm still puzzled, but to stop people from being burned, I've added a note to the readme.

Didn't read the whole thread, but an easy fix for the problem:

sudo mrt

Meteorite isn't running because it tries to install things and update things and all kinds of stuff, and Linux boxes don't like that kinda thing.

And yes, installing Meteor on the same machine as Meteorite will screw things up a bit. I suggest getting rid of Meteor as much as you can and just running with Meteorite as it will handle the Meteor stuff on it's own.

@corysimmons -- I don't think either of those things are the case!

Meteorite should never need to run as root (perhaps unless you want to bind to port 80), and Meteor + Meteorite can happily co-exist on the same machine.

I had this issue with an out of the box Ubuntu node version. Since then it was added to the README to get a newer version.

"Meteorite does not work on Ubuntu 12.04's default Node.js v0.6 (issue #67). To fix this, install a recent version of Node.js via this PPA or by compiling from source."

But a new user wouldn't know that this current issue is related to his node version. It is not clear enough.

I propose to add a validation on meteorite start to validate the node version and give out clear feedback when using an "older/unsupported" version.

capi commented

Adding the check on startup would definitely be a good improvmenet, in my opinion, i second @tjoyal in this regards.

@tmeasday Just speaking from my experiences with it. Seems to run fine with latest Node if you sudo mrt, and I have had problems running Meteorite with previously installed Meteor on the same machine.

What I've seen so far is the follwing. After calling:

sudo npm install -g meteorite

there is a mysterious tmp dir in my home with content owned by root. I don't think it's distribution specific since I've experienced this on Ubuntu 12.10 as well as on Ubuntu 13.04. Also, the content of .npm dir in my home is sometimes - but sometimes it is not - owned by root. Getting rid of tmp and changing privilages on .npm solevd the issue for me. No need to sudo mrt any more.

Yeah I forgot to update this but I just figured out how to get away from that sudo crap. I've only had Terminal for a week or so, so don't crucify me, but I used to sudo install all kinds of stuff.

For the newbs out there (like me a couple days ago), your OS has 2 users: root (which has access to everything, think of this as a "God account" that overrides everything), and the weaker username (in my case "cory").

When you do sudo install foo or sudo npm install foo, it will sometimes put things in directories (or create directories) for your root user.

This sucks because later when you go to npm update it will fail with permission errors because it can't modify node_modules.

The way to fix this is to try the command that gives you a permission error, and find the folder it's not able to write to. In this case usr/local/bin/node_modules or something to that effect (you'll see it when the error is thrown).

Anyway, run chown username path/to/folder to give your account permissions to this folder instead of the root user.

Now you can run npm install (without sudo) and everything will be fine.

Sometimes you need to uninstall each package in node_modules with sudo uninstall -g fooPackage, then immediately reinstall it without sudo (I have to do this for all my packages in node_modules).

Anyway, now it works fine and as a rule of thumb, never use sudo if you can at all help it. meteorite should probably reference this comment in their documentation before a bunch of other newbs like myself go out there and sudo npm install -g meteorite and then have permission issues all the time.

So sudo = room for permission errors, no sudo = mrt works perfectly every single time.

Whether you need to be root when you npm install -g is very OS specific I think.

According to this https://github.com/isaacs/npm/issues/3139 running npm install -g as root isn't necessarily a bad thing to do. I would have expected it to be fine (running mrt as root is a different issue).

If npm is leaving root-owned stuff around the place it sounds like it's a problem with one of our dependencies or a bug in npm itself. If someone figures out where the problem is coming from, let me know!

Hi everyone. If you are having permission problems, please read: https://github.com/oortcloud/meteorite/blob/master/README.md#permission-woes

If you are still having problems, let me know.

After following most of your suggestions, i am still not able to get it working.
I installed node 0.10.7 on Ubuntu 12.04 in a Virtual Box on Windows 8
As i had nodejs and meteor installed before, i removed them before installing meteorite.
Then i did

jens@web:~$ sudo -H npm install -g meteorite
npm http GET https://registry.npmjs.org/meteorite
npm http 304 https://registry.npmjs.org/meteorite
npm http GET https://registry.npmjs.org/ddp
npm http GET https://registry.npmjs.org/underscore
npm http GET https://registry.npmjs.org/wrench
npm http GET https://registry.npmjs.org/fstream
npm http GET https://registry.npmjs.org/optimist
npm http GET https://registry.npmjs.org/prompt/0.2.3
npm http GET https://registry.npmjs.org/colors/0.6.0-1
npm http 304 https://registry.npmjs.org/ddp
npm http 304 https://registry.npmjs.org/underscore
npm http 304 https://registry.npmjs.org/wrench
npm http 304 https://registry.npmjs.org/fstream
npm http 304 https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/colors/0.6.0-1
npm http 304 https://registry.npmjs.org/prompt/0.2.3
npm http GET https://registry.npmjs.org/ws
npm http GET https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/wordwrap
npm http GET https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/pkginfo
npm http GET https://registry.npmjs.org/read
npm http GET https://registry.npmjs.org/revalidator
npm http GET https://registry.npmjs.org/utile
npm http GET https://registry.npmjs.org/winston
npm http 304 https://registry.npmjs.org/ws
npm http 304 https://registry.npmjs.org/mkdirp
npm http 304 https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/wordwrap
npm http GET https://registry.npmjs.org/commander
npm http GET https://registry.npmjs.org/tinycolor
npm http GET https://registry.npmjs.org/options
npm http 304 https://registry.npmjs.org/rimraf
npm http 304 https://registry.npmjs.org/graceful-fs
npm http 304 https://registry.npmjs.org/pkginfo
npm http 304 https://registry.npmjs.org/read
npm http 304 https://registry.npmjs.org/revalidator
npm http 304 https://registry.npmjs.org/utile
npm http 304 https://registry.npmjs.org/winston
npm http 304 https://registry.npmjs.org/commander
npm http 304 https://registry.npmjs.org/options
npm http 304 https://registry.npmjs.org/tinycolor

> ws@0.4.25 install /usr/lib/node_modules/meteorite/node_modules/ddp/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)

npm http GET https://registry.npmjs.org/i
npm http GET https://registry.npmjs.org/ncp
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/deep-equal
npm http GET https://registry.npmjs.org/eyes
npm http GET https://registry.npmjs.org/cycle
npm http GET https://registry.npmjs.org/request
npm http GET https://registry.npmjs.org/stack-trace
make: Gehe in Verzeichnis '/usr/lib/node_modules/meteorite/node_modules/ddp/node_modules/ws/build'
  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
  SOLINK_MODULE(target) Release/obj.target/bufferutil.node
  SOLINK_MODULE(target) Release/obj.target/bufferutil.node: Finished
  COPY Release/bufferutil.node
  CXX(target) Release/obj.target/validation/src/validation.o
  SOLINK_MODULE(target) Release/obj.target/validation.node
  SOLINK_MODULE(target) Release/obj.target/validation.node: Finished
  COPY Release/validation.node
make: Verlasse Verzeichnis '/usr/lib/node_modules/meteorite/node_modules/ddp/node_modules/ws/build'
npm http 304 https://registry.npmjs.org/deep-equal
npm http 304 https://registry.npmjs.org/async
npm http 304 https://registry.npmjs.org/eyes
npm WARN package.json eyes@0.1.8 No repository field.
npm http 304 https://registry.npmjs.org/i
npm http 304 https://registry.npmjs.org/ncp
npm http 304 https://registry.npmjs.org/request
npm http 304 https://registry.npmjs.org/cycle
npm http 304 https://registry.npmjs.org/stack-trace
/usr/bin/mrt -> /usr/lib/node_modules/meteorite/bin/mrt.js
npm WARN package.json github-url-from-git@1.1.1 No repository field.
npm WARN package.json assert-plus@0.1.2 No repository field.
npm WARN package.json ctype@0.5.2 No repository field.
meteorite@0.5.1 /usr/lib/node_modules/meteorite
âââ colors@0.6.0-1
âââ wrench@1.5.1
âââ underscore@1.4.4
âââ optimist@0.5.0 (wordwrap@0.0.2)
âââ fstream@0.1.22 (inherits@1.0.0, graceful-fs@1.2.1, rimraf@2.1.4, mkdirp@0.3.5)
âââ ddp@0.3.2 (ws@0.4.25)
âââ prompt@0.2.3 (read@0.1.1, revalidator@0.1.5, pkginfo@0.3.0, utile@0.1.7, winston@0.6.2)jens@web:~$

But when i type mrt nothing happens :(

What else can i do to get meteorite working?

This a strange one that pops up from time to time. Can you open a separate bug?

Also, it'd be great if you could try running meteorite from source (https://github.com/oortcloud/meteorite/blob/master/CONTRIBUTING.md) and see if that changes anything (or you can insert any debugging and see where it's stopping).

I often get the following error:

 INFO [30e45d11] Running /usr/bin/env mrt bundle bundle.tgz on staging.myapp.com
DEBUG [30e45d11] Command: cd /home/myapp/apps/web/releases/20140702021341 && /usr/bin/env mrt bundle bundle.tgz
DEBUG [30e45d11]
DEBUG [30e45d11]    fs.js:432
DEBUG [30e45d11]      return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
DEBUG [30e45d11]
DEBUG [30e45d11]
DEBUG [30e45d11]
DEBUG [30e45d11]
DEBUG [30e45d11]
DEBUG [30e45d11]
DEBUG [30e45d11]
DEBUG [30e45d11]
DEBUG [30e45d11]
DEBUG [30e45d11]
DEBUG [30e45d11]
DEBUG [30e45d11]
DEBUG [30e45d11]
DEBUG [30e45d11]
DEBUG [30e45d11]
DEBUG [30e45d11]
DEBUG [30e45d11]
DEBUG [30e45d11]    ^
DEBUG [30e45d11]
DEBUG [30e45d11]    Error: EACCES, permission denied '/usr/local/lib/node_modules/meteorite/bin/mrt.js'
DEBUG [30e45d11]        at Object.fs.openSync (fs.js:432:18)
DEBUG [30e45d11]        at Object.fs.readFileSync (fs.js:289:15)
DEBUG [30e45d11]        at Object.Module._extensions..js (module.js:473:44)
DEBUG [30e45d11]        at Module.load (module.js:356:32)
DEBUG [30e45d11]        at Function.Module._load (module.js:312:12)
DEBUG [30e45d11]        at Function.Module.runMain (module.js:497:10)
DEBUG [30e45d11]        at startup (node.js:119:16)
DEBUG [30e45d11]        at node.js:906:3

It happens when I update node, npm, etc.

To solve it, I simply run under my app user $ sudo -H npm install -g meteorite. From what I see, this command creates /root/.npm chowned to my app user, is this normal?

Any idea why I need to do that? I'm trying to automate everything in Chef.