Can't install, update or run Meteor after update - meteor

I have been working with Meteor apps for a few months. For the first time, anytime I try to run a meteor app, install via (curl https://install.meteor.com | /bin/sh) or run meteor update, I get this error:
module.js:340
throw err;
^
Error: Cannot find module 'fibers'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at Object.<anonymous> (/usr/local/meteor/app/meteor/meteor.js:1:75)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.runMain (module.js:492:10)
In the past I'd get random js errors and reinstalling would fix, but I cannot even run the installer or update now. Perhaps it is related to 0.6. Thanks for any insight!

This solution worked for me:
Install the latest Node via the graphical installer at http://nodejs.org/ EDIT: should not be necessary.
Install Fibers via sudo npm install fibers#1.0.1 -g per #Akshat EDIT: should not be necessary.
Delete the file /usr/local/bin/meteor
Delete the folder ~/.meteor
curl https://install.meteor.com/ | sh

I had this happen (again) and did more research. I ended up doing these two steps to address it:
Remove Meteor:
rm -rf /usr/local/meteor /usr/local/bin/meteor
Install Meteor:
curl https://install.meteor.com | /bin/sh

I ended up going to my working computer, grabbing the usr/local/bin files and copy/pasting to the non-working computer. May not be ideal, but it got the job done and I am back coding on both machines. Thank you Akshat very much for the diligence on this issue!
Paul

Try restarting your computer/reloading a terminal because the new meteor is installed in a new location too (it looks like yours is still at /usr/local instead of ~/.meteor)
If that doesn't work install fibers with npm install fibers#1.0.0 -g.

I came across this problem too. As it turns out it was a permissions problem with meteor installed on my mac as root. I reinstalled meteor as the logged in user (with files that are in ~/.meteor). Everything then worked fine.

When you bundle / build meteor on one environment (i.e. OS X) and then try to deploy on a different environment (i.e. Ubuntu) it seems that meteor includes the wrong libraries.
I could be wrong in this, in any case I found that uninstalling and re-installing the bcrypt library worked for me (well at least it got me to the point where I get other errors)
Find the directory where npm list bcrypt exists, then type npm remove bcrypt and then npm install bcrypt.
In Meteor V1.2 this is easy to find. In Meteor V1.3 I think it's in .../bundle/programs/server/npm/node_modules/meteor/npm-bcrypt

Related

Meteor (1.4.1) checkout not able to run on code ship server

I am using code ship to run some tests and deploy to galaxy.
Right now the setup works by running meteor from a git checkout. The following is the setup script:
git clone https://github.com/meteor/meteor.git ~/meteor
cd ~/meteor && git reset --hard 365c765 && cd -
export PATH=~/meteor/:$PATH
meteor npm install
Right now I cannot get passed the meteor npm install command without throwing an error. The error is the following:
It's the first time you've run Meteor from a git checkout.
I will download a kit containing all of Meteor's dependencies.
######################################################################## 100.0%
Installed dependency kit v4.2.9 in dev_bundle.
/home/rof/meteor/tools/cli/dev-bundle.js:55
return getDevBundleForRelease(release).then(function (devBundleDir) {
^
TypeError: Cannot read property 'then' of null
at getDevBundleDir (/home/rof/meteor/tools/cli/dev-bundle.js:55:41)
at Object.<anonymous> (/home/rof/meteor/tools/cli/dev-bundle.js:205:18)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.getDevBundle (/home/rof/meteor/tools/cli/dev-bundle-bin-helpers.js:6:10)
at getChildProcess (/home/rof/meteor/tools/cli/dev-bundle-bin-commands.js:28:13)
What do I need to do in order for the meteor install to work on code ship?
There's a script available at https://github.com/codeship/scripts/blob/master/packages/meteor.sh that should take care of the installation.
Include it in your setup steps by adding the following command
curl -sSL https://raw.githubusercontent.com/codeship/scripts/master/packages/meteor.sh | bash -s
If this doesn't work for your project, please open a new issue on the repository or reach out to Codeship Support via https://helpdesk.codeship.com and we'll take a look.

firebase-tools error: EACCES: permission denied

I am trying to deploy Firebase hosting of my web app.
At the command line, when I type firebase deploy, I get the following error.
Note: firebase deploy is just one example. The same error occurs for all firebase commands. (e.g., firebase --help, firebase -v, firebase login, firebase logout, etc.)
Error
/usr/local/lib/node_modules/firebase-tools/node_modules/configstore/index.js:53
throw err;
^
Error: EACCES: permission denied, open '/Users/mowzer/.config/configstore/update-notifier-firebase-tools.json'
You don't have access to this file.
at Error (native)
at Object.fs.openSync (fs.js:549:18)
at Object.fs.readFileSync (fs.js:397:15)
at Object.create.all.get (/usr/local/lib/node_modules/firebase-tools/node_modules/configstore/index.js:34:26)
at Object.Configstore (/usr/local/lib/node_modules/firebase-tools/node_modules/configstore/index.js:27:44)
at new UpdateNotifier (/usr/local/lib/node_modules/firebase-tools/node_modules/update-notifier/index.js:34:17)
at module.exports (/usr/local/lib/node_modules/firebase-tools/node_modules/update-notifier/index.js:123:23)
at Object. (/usr/local/lib/node_modules/firebase-tools/bin/firebase:5:48)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
Everything I have tried so far (including every CLI firebase instruction) rejects me for lack of access.
What can I do? What should I try?
(I am on a Mac OSX Yosemite v10.10.5 and firebase-tools v3.0.3)
Edit: When I do sudo firebase deploy, I get the following error.
Error: The entered credentials were incorrect.
I tried the following solution.
I tried to delete problem files then reinstall firebase-tools.
Terminal.sh
cd
cd .config/configstore
# Delete problematic files
rm firebase-tools.json
override rw------- root/staff for firebase-tools.json? y
rm update-notifier-firebase-tools.json
override rw------- root/staff for update-notifier-firebase-tools.json? y
# Reinstall firebase-tools
cd
sudo npm install -g firebase-tools
Then...
cd path/to/directory
cd firebase deploy
Now this file generates the error:
/usr/local/lib/node_modules/firebase-tools/node_modules/configstore/index.js:53
cd /usr/local/lib/node_modules/firebase-tools/node_modules/configstore
I fix it by adding sudo at the beginning of the command line!
This looks like an issue with the permissions of modules you have npm installed. This is something lots of developers run into, and npm actually has some documentation on how to resolve it. Once you go through that, try again (you may need to re-install firebase-tools) and things should work.
I had the same issue, and I fixed it by using this command curl -sL firebase.tools | upgrade=true bash
Add sudo prior to command it should work
sudo npm -g i firebase-tools
I had the same issue, and I fixed it by doing chmod 755 on all the files in the configstore directory
Expanding more detail to the solution provided by #jacobawenger:
The most robust solution is to install Homebrew and let Homebrew manage the npm package installation for you.
Terminal.sh
# EACCESS error reference: https://docs.npmjs.com/getting-started/fixing-npm-permissions
# Install Homebrew # Reference: brew.sh # Ensures NPM is installed properly to avoid EACCESS errors
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install npm # Reference: brew.sh
brew install node
# Install firebase-tools
npm install -g firebase-tools # Non-recurring task # Also updates to newest version (see notice)
Easy Way:
Back up your computer.
if you have Permission issue run first this
sudo chown -R $USER /usr/local/lib/node_modules
then 2nd
1)- mkdir ~/.npm-global
2)- npm config set prefix '~/.npm-global'
3)- export PATH=~/.npm-global/bin:$PATH
4)- source ~/.profile
5)- npm install -g jshint
6)- NPM_CONFIG_PREFIX=~/.npm-global
You can try using the --unsafe-perm flag. Just like this:
sudo npm install -g firebase-tools --unsafe-perm
Try run the command as
su root
if you are using ubuntu.
For me, just use sudo, did not work.
I'm using Ubuntu 18.x.x and I was trying install firebase through npm
What worked for me was basically reinstalling the node using the node version manager.
For this, you just install latest node js version this way
In my case at the point of this reply, the LTS Version of the Node JS is v14.17.0 hence nvm use 14.17.0 now try re-running the build.
i faced the same issue recently.
running this command solved the issue for me
sudo chown -R $USER ~/.config/configstore
There's information explaining why the sudo command makes the difference, and generally, when we are calling commands in terminal mode, we are not recognised as the computer's administrator, whereas certain commands are reserved for the administrator only. The sudo command enables terminal commands to be executed as the administrator. You can read about the sudo command here : )
Thank you for your contributions towards resolving this issue.

Deploying Meteor app from OS X to Linux causes bcrypt issues

I have just deployed my first production Meteor app, but ran into a pretty significant issue. When I tried to run my app, I get the following error:
/home/hiapp/bundle/programs/server/node_modules/fibers/future.js:173
throw(ex);
^
Error: /home/hiapp/bundle/programs/server/npm/npm-bcrypt/node_modules/bcrypt/build/Release/bcrypt_lib.node: invalid ELF header
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at bindings (/home/hiapp/bundle/programs/server/npm/npm-bcrypt/node_modules/bcrypt/node_modules/bindings/bindings.js:74:15)
at Object.<anonymous> (/home/hiapp/bundle/programs/server/npm/npm-bcrypt/node_modules/bcrypt/bcrypt.js:1:97)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
Through some research, it seems that the issue is that bcrypt is platform-specific, and because my development is on OS X 10.10, but my production server is on Ubuntu 14.04, there-in lies the problem. My work around was to run npm install bcrypt from the programs/server folder, then copy that from programs/server/node_modules/bcrypt to programs/server/npm. This seems like a lot of manual steps.
I am just about to re-deploy my app with some fixes, and I am worried that I am going to have to again perform the same steps. Is there a better way to deploy a Meteor app where you do not run into this issue? My procedure currently is:
Run meteor build
scp resulting tarball to my server (Digital Ocean)
explode the tarball in my app users home directory
ADDED STEPS: recompile bcrypt and copy the directory over as stated above
I am guessing the auto-refresh will be broken as the first time the server tries to load the new libraries it will explode in fiery glory. Would it be better to simply clone the GIT repo on the server and do the build straight from there, or can I use mup or any other tools to help smoothen the deployment process?
There are two ways of getting around this time-consuming problem which are totally dependant on how you deploy.
Manual deploy
If you are manually deploying your app then make sure that you are using node v0.10.361 and only that. Meteor does not work well with node v0.12.x. More specifically, the fibers module causes a lot of problems, it chokes on various errors2.
The following is the procedure that fixed it for me3, 4:
Remove the bcrypt module from the npm directory:
$ cd path_to_your_app/bundle/programs/server
$ rm -rf npm/npm-bcrypt/node_modules/bcrypt/
Install the bcrypt module into the node_modules directory first. This builds bcrypt against the server's OS:
$ npm install bcrypt
Move the newly created bcrypt module into the npm directory:
$ cp -r node_modules/bcrypt npm/npm-bcrypt/node_modules/bcrypt
Finally, restart the app, mogodb and any web server processes such as nginx6, through upstart if you have it configured. Under the heading sanity steps below you can perform if the steps outlined above have not fixed it for you.
Using Meteor Up (mup)
If you are using mup then the process is much easier as other answers on this thread point out. However, there are cases where errors still arise including the invalid ELF header error. Make sure you have the most recent version of mup npm update mup -g.
The first step is to remove any pre-existing app and nodejs package. Mup installs the app into /opt/ and within there you can find your_app and nodejs. Remove them.
Verify that you have the correct node version, 0.10.36 only1 and the following settings, in the mup.json file:
{
...
"setupMongo": true,
"setupNode": true,
"nodeVersion" : "0.10.36",
"setupPhantom": true,
"enableUploadProgressBar": true,
// Application name (No spaces)
"appName": "your_app",
// Location of app (local directory)
"app": ".",
...
}
Run:
$ mup setup
$ mup deploy
Navigate to the server folder on your server and rebuild modules:
$ cd /opt/your_app/app/programs/server
$ npm rebuild
$ npm install
Optional: $ sudo npm update node-gyp -g
Finally, restart the app, mogodb and any web server processes such as nginx6. After the above steps, you may want to look at sanity steps below for more debugging options.
Sanity steps
There are a few other steps you can perform:
Note that apache may also bind itself to the same port that nginx is running on. Look at your app's error logs and your web server's error logs to see if there are any issues. Stop apache via sudo service apache2 stop or brute force close (not recommended) any running processes on port 80.
Then remove or move the apache2 conf file to prevent it from starting up again. All conf files are located in /etc/init or /etc/init.d.
Use $ mup logs -f to view mup logs. To view errors from your app, the end of the file, /var/log/upstart/your_app.log is useful (assuming you have upstart configured).
If using nginx make sure your directories are symlinked.
$ ln -s /etc/nginx/sites-available/your_server_config /etc/nginx/sites-enabled/your_server_config
Moreover, make sure that you have specified a default_server5 in your_server_config.
Check that mongodb can run.
References
Meteor version 1.0.4.1 (released near the end of March 2015) requires that node version 0.10.36 be installed. I recommend using the node version manager, n, to control what version of node is running on your server at any one time. Link.
The dreaded [XXX.XX.XXX.XX] Error: '/opt/your_app/programs/server/node_modules/fibers/bin/linux-x64-v8-3.28/fibers.node' is missing. Try reinstalling 'node-fibers'? error. Link.
The procedure is modified from here: Link.
For your information, I used DigitalOcean's very helpful guide on deploying a meteor app to a server. Link.
Specifying a default_server. Link.
Common processes to restart are: sudo service mongod/nginx/yourapp restart.
I had the exact same issue - I switched to using Meteor Up (MUP) instead and the problem went away. Not to mention its a lot more straightforward!
I followed this tutorial on youtube - https://www.youtube.com/watch?v=WLGdXtZMmiI which covers deploying using MUP to Digital Ocean.
MUP's github page specifically mentions that it handles binary NPM modules - https://github.com/arunoda/meteor-up#binary-npm-module-support
Hope that's some help!
Running npm rebuild at bundle/programs/server/npm/ should take care of rebuilding the modules for the server platform, regardless of the original app being bundled at Linux or MacOS.
I had the same issue and did the following to fix it:
Uninstall nodejs
sudo apt-get remove nodejs
Remove any remaining files
rm -rf ~/.nvm ~/.npm
sudo rm -rf /usr/bin/node /opt/nodejs /usr/lib/node_modules /usr/local/lib/node_modules
Upgrade node version from the default setting in mup.json
"nodeVersion": "0.10.33",
Run mup setup and deploy
mup setup
mup deploy

meteorite cant run metorite npm error

when i do this:
$ mrt create myapp
$ cd myapp
$ mrt
i get this error message:
livedata: updating npm dependencies -- sockjs, websocket...
No dependency info in bundle. Filesystem monitoring disabled.
=> Errors prevented startup:
Exception while bundling application:
Error: Command failed: npm WARN package.json packages-for-meteor-smartpackage-livedata#0.0.0 No README.md file found!
i have this from the new "discover meteor" book by sasha greif.
thanks in advance.
I had a similar problem as I was following through the Discover Meteor book as well. It might be the same error you are having but I can't remember it exactly, it was rather long and suggested running mrt as root/administrator. Also, I'm not sure if the error I was having was related to the version of Node.js that I was using (0.10.6 on Ubuntu).
Thanks to a comment posted on github by Apendua (https://github.com/apendua) I was able to run mrt successfully without having to run as root/administrator.
Here is what he found:
"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."

Meteor bundle fails because fibers.node is missing

The bundled node.fibers fails to load after deployment to a different server with the following error:
/home/ec2-user/bundle/server/node_modules/fibers/fibers.js:13
throw new Error('`'+ modPath+ '.node` is missing. Try reinstalling `node-fibe
^
Error: `/home/ec2-user/bundle/server/node_modules/fibers/bin/linux-x64-v8-3.11/fibers.node` is missing. Try reinstalling `node-fibers`?
at Object.<anonymous> (/home/ec2-user/bundle/server/node_modules/fibers/fibers.js:13:8)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at Object.<anonymous> (/home/ec2-user/bundle/server/server.js:3:1)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
Node fibers have to be re-installed after unpacking the bundle. To fix this problem go to the server directory.
$ cd bundle/programs/server
Then un-install fibers
$ npm uninstall fibers
Then install fibers
$ npm install fibers
Then start your application
$ cd ../../
$ PORT=3000 MONGO_URL=mongodb://localhost:27017/myapp node bundle/main.js
You will have to repeat that every time you update the app. This is just the way Meteor uses Node at the moment. Potential long-term fix can be found here: http://meteorhacks.com/how-meteor-uses-node.html
NOTE: On Meteor 0.6.5 and Node 0.10.* this may work slightly differently. You may have to remove fibers manually from bundle/server as well as bundle/programs/server. You can do that with $ rm -R node_modules/fibers. Then you'll have to reinstall fibers from both locations with $ npm install fibers.
I had the same issue with Meteor 1.0.3.2 and Node 0.12.0.
I had to downgrade to Node 0.10.31.
This fixed the issue.
Remember all instructions are in the readme file in the bundle folder.
Mismatched Node Versions
The versions of node MUST match when you do the npm install and when you run the meteor app: node app.js.
Otherwise you can end up with different versions of expected glibc folders...
To see if you have this problem:
note the runtime error you are seeing. For example, in my case:
Try running this to fix the issue: /usr/bin/node <bundle location>/bundle/programs/server/node_modules/fibers/build
Cannot find module '<bundle location>/bundle/programs/server/node_modules/fibers/bin/linux-x64-83-libc/fibers`
The fix instructions referred to /usr/bin/node even though I was managing my node version via nvm.
The executable was looking for fibers in the linux-x64-83-libc folder.
navigate to bundle/programs/server/node_modules/fibers/bin & examine your glibc subfolders. In my case: linux-x64-57-glibc & linux-x64-64-glibc
My executable is looking for linux-x64-83-libc & it does not exist.
Notes
In my case I was using nvm to manage my node versions. But as I could see in the fix instructions, my executable was using /usr/bin/node and not the nvm version I was expecting.
Fix
I removed the /usr/bin/node version via sudo apt-get remove nodejs and all was good. Everything started using the nvm version.

Resources