I had to submit my nodejs application (written on JS and built with express generator) on the university network.
As my supervisor tried to run the application it did not render on chrome. Instead it did not build the css. The versioning of node are correct so no version Problem.
Please help!! :)
Is there a ReadMe file, with step by step instructions? Might sound flippant but since I started to document stuff like, "git clone xxxxxx, cd xxxxxx, npm install, npm run dev" the number of issues i get from new team members has dropped.
Related
I'm new to node.js and just went through basic tutorials and now ready to set my project with Express.js installed as well.
I'm just wondering what happens if I change my project name to something else now that I've got the framework in place. Can I simply just rename the project directory or do I need some npm package to refactor it properly?
With Ruby on Rails, there is a gem for this purpose and wonder if it's the same for node.js project.
Can I simply just rename the project directory?
Yes.
Express is just a library.
Express-generator (which proviedes "express" command line) is a tool (not actually a framework) to easily build a basic project layout with express, jade and a few other common packages.
Out of the box you can run it by executing ./bin/www (or node bin/www).
Until now, project name doesn't care so far except for if you put it in some template, database register, etc...
Sure you will use some version control system (vcs) like git or subversion and, if you don't want to publish it as npm module, you doesn't need nothing more.
But, even if you doesn't plan to publish it at npm, it is a wonderful tool to manage your project packaging.
If you did it, (by executing "npm init"), then you can take advantadge of some facilities like:
Launch your project with 'npm start'.
Install modules with 'npm --save module_name'.
DON'T track node_modules directory in your vcs.
Get fresh node_modules directory for your current node version with 'npm install'
etc...
All this magic is thanks to a file named 'package.json'.
This file was generated when you did (if you did it) 'npm init' and contains a package name and a version number.
If you doesn't plan to publish your package it also doesn't care so much. But it is a bit more polite to update it accordingly if you rename your project.
I am trying to get up and running with Meteor and seeing what it can offer, while I like it overall, it seems it's a very very rigid system.
I set up a small testing setup using Velocity, it opens a small overlay window on the side which has a class of "velocityOverlay". The overlay is really small and makes error stack traces wrap. All I wanted to do was to edit the css of the "velocityOverlay" and increase the width.
I somehow (after wasting time) managed to find that Meteor is actually putting all the packages in my user directory by default, once I found that, I found the needed css file...
velocity_html-reporter/.0.5.1.aykpxq++os+web.browser+web.cordova/web.browser/packages/velocity_html-reporter/lib/client-report.less.css
And I did a small edit to the width, next thing you know the meteor app crashes when trying to launch using the "meteor" command throwing a "Error: couldn't read entire resource" error. I can't even edit the bootstrap.css file I installed using "ian_bootstrap-3".
Further more, I can't find any way to install packages locally just for my particular project, what if I wanted to modify a package only for my particular project? this is very easy to do in vanilla Node.js, you simply don't use the "-g" when using "npm install".
To add to that, within my project root, there is another ".meteor/local/build/web.browser" folder with most of the global package files replicated again. When does Meteor use which? This is very confusing.
You can run a package locally very easily.
Download it from Github (for example) and put it in the packages/ directory of your application like this /packages/package_name.
Then add it to your application with the same meteor add package_name command as usual.
Meteor will automatically look in the local folder before anywhere else and compile the package with the rest of your code.
This allows you to do any modification you want on the package and test it locally before publishing it to the registry.
Also, folders located in .meteor/local/* are used for building purpose only and are generated automatically by Meteor. So it is not the best place to edit the files!
This worked for me https://atmospherejs.com/i/publishing. mrt link-package didn't work for me, might just be outdated code.
Steps:
Download (or clone) package from GitHub to local dir
Stop meteor if running
2.1. Make sure you have a packages folder: mkdir packages
Locally link your package:
3.1 If you have mrt installed: Run mrt link-package /path/to/package in a project dir
3.2 If you don't have mrt: ln -s /path/to/package packages/package
Then run meteor add developer:package-name, do not forget to change package name
Run meteor in a project dir
From now any changes in developer:package-name package folder will cause rebuilding of project app
Download the package and place it in new package directory in your project root.
open the package.js inside the downloaded package and remove the author's name in the property "name:"
e.g: - name:'dburles:google-maps' to name:'google-maps'
then run
meteor add google-maps
So I am very new to Meteor, and I was sifting through some example apps and open source projects when I came across this simple chat application:
(https://github.com/BenderV/simplechat)
I wanted to download the project, run it on my local server, and mess around with the code to learn more about what does what, and how to use the Meteor framework. I simply downloaded the .zip file from github and tried to run it (using the meteor in my terminal. However I got the following error when I ran the application locally in my browser:
Your app is crashing. Here's the latest log.
=> Errors prevented startup:
While building the application:
error: no such package: 'accounts-guest'
error: no such package: 'user-status'
error: no such package: 'accounts-testing'
error: no such package: 'fontawesome4'
error: no such package: 'iron-router'
error: no such package: 'bootstrap-3'
error: no such package: 'fast-render'
error: no such package: 'jquery-titlealert'
error: no such package: 'related'
=> Your application has errors. Waiting for file change.
I can (obviously) infer from the nature of the log that the error that I am experiencing is because I don't have the correct packages installed (the one that are listed, obviously).
So keeping this in mind, I researched how to add packages to meteor (using instructions I found on Atmosphere JS pages of the respective packages). However, when I entered the command that was provided by Atmosphere into my terminal (for example for, 'accounts-guest' package I entered: meteor add artwells:accounts-guest). Unfortunately doing this did not work, and I was given something like the following error in the terminal: artwells:accounts-guest: no such package
I have no idea what to do, the packages will not install so I can not try this code. I come from experience with Rails, and in Rails if you needed to install "gems" (pretty much the same thing as packages in Meteor) you could just enter bundle install into the terminal to download and install undefined packages. Is there something like this in Meteor? I have heard of something called Meteorite, but am unsure what it is and how to use it.
Anyways I really would appreciate any help in getting me past this minor roadblock on my way to learning Meteor!
Thank you
That's an older project which use the old packaging system 'meteorite' = 'mrt' on the command line.
I suggest you try a newer example, Meteor ships with a few. Once you have Meteor installed you can create an example app by typing one of the following commands :
meteor create --example leaderboard
meteor create --example todos
meteor create --example localmarket
And yes, there is a very similar mechanism to the gems commands you are accustomed to. Simply running a project 'meteor' should download its dependencies. Also you can run 'meteor update' if you want to update to the latest versions for your project.
Last August there was a major update to the meteor package management system, you can read more about it here : https://www.meteor.com/blog/2014/08/26/meteor-090-new-packaging-system
So, for any examples you'd like to check out, try and get a recent one, from meteor 1.0. In newer versions of meteor those instructions on Atmosphere should work out fine for you.
You can see what version of meteor a project is running by looking at this file ".meteor/release" inside a meteor project :
https://github.com/BenderV/simplechat/blob/master/.meteor/release
so you can see that one is old.
good luck!
I have installed Meteorite on my mac, and am trying to run the test program provided as a mysql project. When I use the command 'mrt', I get:
Stand back while Meteorite does its thing
Done installing smart packages
Ok, everything's ready. Here comes Meteor!
[[[[[ /Users/lfrey/Desktop/Thesis/test-meteor-sql ]]]]]
=> Errors prevented startup:
While building the application:
node_modules/meteor/app/lib/unsupported.html:1: Can't set DOCTYPE here. (Meteor sets for you)
node_modules/meteor/app/meteor/meteor.js:1:15: Unexpected token ILLEGAL
=> Your application has errors. Waiting for file change.
I have tried re-installing nom, meteor, meteorite, and mysql in various combinations and have not been able to eliminate the error. If I remove the command, then I get an error about invalid HTML syntax.
Your app might not be created properly. You have a node_modules directory in your application which you might have added with npm install.
Meteor does not install modules with npm install manually, it doesn't work because it parses files in the node_moules directory as part of your meteor app (in the wrong way - not as an npm module).
You have to make sure the package you use uses Npm.depends in your package's package.js. The standard Meteor-SQL package already does this for you so you don't have to worry about it.
Which SQL package did you use? As far as I can see none of them install anything with npm install nor do they have instructions to.
The simple fix to get your app working is to remove the modules you installed by deleting the node_modules directory in your app.
I am new to node.js,today I joined in another team they are working with node.js,backbone.js,marionette.js and sqlserver.I have an idea about backbone,Marionette but I never work on node.js.They asked me to clone the git repository,As per their suggestion I installed node.js.
After cloning the repository,I got the files just in the following way.
I opened node_modules folder,It has nearly 10 sub-folders are there.
node-sqlserver doesn't have any files inside.might be because of that I am getting the following error while server running time.
I ran the server with the following command
node server.js local
getting the following error
I don't know,why I am getting.can anyone help me.
Thanks.
You need to install all the dependent modules through npm install, In your case, you need to install node-sqlserver.
npm install node-sqlserver
Generally your source code will be having a package.json. This file specifies all the
dependent modules required to run the application, but here this file is missing.