jansmolders86 / mediacenterjs

A HTML/CSS/Javascript (NodeJS) based Media center
http://mediacenterjs.com
1.29k stars 243 forks source link

Npm install #143

Closed benzen closed 9 years ago

benzen commented 10 years ago

Using npm install mediacenterjs should instal mediacenterjs on the local machine according the the doc. In my case it didn't. In fact i didn't event see a local folder.

Is this realy supposed to work ? if it's not up to date then i think it's better to remove it from the doc.

Jon889 commented 10 years ago

npm will only install in a folder called node_modules, so make a folder called that and then copy the mediacenterjs folder out of it. The documentation should probably be changed to reflect this.

However you'd be better off cloning it from github or downloaded the zip from github as it will be a later version, if I'm not mistaken nom will install the alpha, and since then there have been many changes.

jansmolders86 commented 10 years ago

Thanks Benzen for your report and trying out MCJS!

NPM can only install packages. Hence the name and hence mediacenterjs is installed as a package. So we kind of abuse NPM for installing MCJS in this manner. I'll update the readme to reflect this! I agree this isn't the most ideal method but like Jonathan said, the best method is still just cloning the repo to get the latest version.

I'll update NPM and the windows installer once we go beta!

Thanks both of you!

tracker1 commented 10 years ago

You should be able to specify scripts that can be used, and get installed as part of a global install (like lessc, coffee-script, uglifyjs, etc)...

npm install -g mediacenterjs
mediacenterjs setup

Would be an appropriate path for doing this... :-) Where the first part does the global install, the second will setup whatever initialization needs to happen for the local system.

mediacenterjs [command] (options)

the "script" that it adds could even be simply mcjs for a short name... but that would be entirely optional imho.

benzen commented 10 years ago

In my case, the execution of npm install mediacenterjs Didn't create a node_modules folder.

When i've done it with global option like @tracker1 proposed, the medicanterjs package seems to be installed correctly. But then I can't run mediacenterjs setup

The command 'mediacenterjs' isn't founded

Jon889 commented 10 years ago

benzen, that isn't current functionality so it won't work now. Also not doing it globally, you have to create the node_modules folder yourself, it won't do it for you. (The reason is if you install a module, but you're in a subdirectory of your project it will go up to the project directory's node_modules folder rather than create a new one in the wrong place)

Installing it globally doesn't seem like too good of an idea, if it was a command that would be used more than once then it would be ok, but you'd only need to set it up, any maintenance or anything would be done through the UI, so you'd be cluttering the global for little use.

tracker1 commented 10 years ago

@benzen @Jon889 I know it isn't the current method... I was proposing making that the method...

The reason to use global as a general practice is that the application needs to live somewhere and the global npm path makes as much sense as anywhere else in this case. I don't see that it's "cluttering" the global any more than anywhere else it may be installed... if npm is going to be used, you should follow npm convensions.

benzen commented 10 years ago

I did'nt get the fact that it was a proposition. Sorry for that. I do agree with @tracker1, to me it make sense.

But it's true that depend a lot on the way we want to ship new version of the app.

Jon889 commented 10 years ago

Sorry I was just thinking you meant an installer in the global folder, which would install it somewhere. No idea how I got that idea in hindsight :)

jansmolders86 commented 9 years ago

Closing this as the discussion continues in issue #144