noob at January 8th, 2015 21:30 — #1
I followed the instructions to extend gruntfile several times, but got missing package errors in webhook app, no folder for new dependencies in node modules.
So... does that mean packages need to be installed individually via command line (mac) before I can add them to gruntfile and json?
When it says to place lines "at the end of" json file, I assume it meant within the brackets in with the dependencies, no?
davesnider at January 8th, 2015 21:50 — #2
If you're getting a missing package error have you added the proper scripts to the bottom of your package.json file? If so, did you run an
npm install in your site directory to install those packages?
budparr at January 8th, 2015 21:52 — #3
When you add a module are you using something like this (below) at the command line?
npm install --save-dev package-name
Here's an example Gruntfile from one of the Webhook themes. https://github.com/webhook/webhook-theme-foundation/blob/master/Gruntfile.js
Hope that helps, at least as a start!
budparr at January 8th, 2015 21:53 — #4
crossed paths with you, @davesnider, posting just as you did.
noob at January 8th, 2015 23:34 — #5
Yeah, I did all the steps outlined multiple times... then figured out that it must be because I have to do npm install to load the node modules. Unfortunately.... that's when my day went very very wrong.
I had a working install of node, npm, and nvm this morning, but...
Npm install just would not work in that directory. A suggestion elsewhere that it was a permissions issue caused by original sudo install of node led me down a 12 hour rabbit hole of flawed advice and more installs and uninstalls of key components than I care to count leaving me with a mess of orphaned dependencies, and more errors than I've ever seen with node, nvm, and npm ALL not working... on the only clone of a system disk that died a week ago. I don't even know where to start.
I guess I'm going to have to learn a LOT in short order about searching and destroying orphaned files in various locations, finding and fixing paths, etc. Ouch.
Maybe I can still install the whole works locally though... I'll deal with the rest as it comes, I just want to get this site moving forward ASAP.
Never tried installing the major bits to a local directory before (node, npm), but that could work, no?
davesnider at January 9th, 2015 12:36 — #6
If you haven't yet, you might want to try using the Webhook App, which is a little bit more self-contained and easier to work with.
noob at January 9th, 2015 12:53 — #7
I am. That's why I was confused. I was under the impression that it contained local install of node. Is there some step then to do npm install via the app that extends the gruntfile? I was under the impression I could add to json and gruntfile, and app would take care of the rest, but it didn't. I stopped and restarted it. Is there another command? I don't see much documentation for the app. Maybe I overlooked it. If I can easily add, subtract, and wire dependencies via the app, that would be a lifesaver right now.
I don't mind digging into the gruntfile, json, etc. It's the system install stuff that's been driving me batty. I'm sure quite a lot of folks feel the same way. If the app does indeed handle that stuff, then I don't think you're making nearly a big enough deal about the app. Not having to deal with a bunch of system issues, hidden files, etc via terminal is a big deal for people who aren't die hards... which of course means a much greater demographic for what is already a great product that you've got.
davesnider at January 9th, 2015 13:10 — #8
It's not a part of the app currently. When we built it originally the intention was that it would be for people not familiar with the command line and just wanted the basic webhook experience. Of course after time people start wanting to do more with webhook and extending it with other node libraries. Unfortunately, that brings people back to the command line, which can be a little trickier to set up if you're new to this kind of thing.
It's obviously hard for us to troubleshoot your node install. Best we can advise is to work backward, try and uninstall everything you can, then reinstall.
If you're desparate and really want to use the app a workaround you can try is to build our your Gruntfile.js and package.json file how you want it with the node programs you need. Then, zip those two files into a theme. Create a new webhook site, then choose "select a theme", using your zip file as the theme. During the theme installation the app should run an npm install based upon your package.json file.
From there, you can copy/paste over your pages, templates and static files from whatever site you'd already started work on. Just make sure you don't paste over the cms.html or .firebase.conf files.
Obviously, longer term you want to get your node situation handled so you can use the command line tools. We'll look into adding an "update files" button within the app that will run a "wh update / npm install" from the app itself manually, but that will take us a few days.
Also, I have no idea what node libraries you're trying to add but if they happen to be sass, less or coffeescript, you can simple use our "preprocessor" theme to get started, rather than creating your own theme.
noob at January 9th, 2015 13:49 — #9
Great info. I am working on straightening it out right now.
I've read through all of your documentation which is great, and going back over the bits that I wasn't clear on the first time around. I'm not quite there yet, but I learn quickly.
A simple gui that can add, delete, version control, and wire dependencies using all local and self contained resources which can't screw up the user's system would be godsend. Webhook is already 90% of the way toward connecting the dots for me which is more than I can say for any of the other systems I've seen out there... but that 10% is still kicking me in the teeth.
Actually, I was just trying to install Compass (and require susy). Should be a simple thing, right? It's the system/path/sudo/nvm vs brew crap that keeps tripping me up. When it all works, it's great. When something doesn't, it's a bottomless rabbit-hole.
Thanks as always. You're my hero, Dave.
davesnider at January 9th, 2015 14:13 — #10
compass is actually a ruby library. Should be easy to install. I'll let you google that part
noob at January 9th, 2015 16:40 — #11
I think I finally get it. I think for me the issue came down to the documentation being written before the app existed, so not covering that case. Correct me if I am wrong, but...
1) The gruntfile just tells grunt what commands to execute like running a server, compiling js, minification, deployment tasks, etc.
2) In order to do that, it needs to access the corresponding node modules.
3) To set up those modules, there needs to be a corresponding package.json file that has a list of all the packages and their dependencies.
4) In order for the dependencies to load they have to be installed somewhere (like on user's computer globally)
5) Some of them (those included in themes including base theme) don't have to be installed on user's computer previously because the app installs and generates them.
6) BUT... and here's the kicker... it is the theme generation command that installs them, and there is no way to issue that command or any other command that generates new ones once the theme has been generated.
I kept trying to do things like restarting the app. Wasn't exactly clear on what it was that triggered module directory build. If above is all correct, it leaves me wondering two things:
1) Why was I able cd into other directories and install those same node modules, but not into that one? (tools working again, btw)
and more importantly:
2) Is it just that the app itself lacks an update files button for an easy solution, or is it that if you're using the app, the files can't be updated even with terminal commands because terminal lacks the ability to call wh tasks? If so, then yeah, I need to start over either with template creation method above, or by skipping app and going with terminal install.
davesnider at January 9th, 2015 17:05 — #12
Good job! Sure you learning a bit about how node modules and grunt works. Your assumptions are correct. Now to your questions.
- No idea. Typo or something maybe? Maybe you ran sudo when you ran wh create and created a weird permissions system. Maybe your node_modules folder got corrupted in one of them. You can always safely delete the node_modules folder and run an npm install in that directory to rebuild it.
- It's just that the app doesn't have an update button. We tried to make it pretty passive. It only runs
wh update when we release a new version. That command happens to run
npm install, which is also run when new themes are installed. Normally, when people are changing Grunt and package.json files the assumption is they are using the CLI rather than the app, because those tools by nature are usually run by the command line.
Basically our philosophy is... hey, if you're kind of new to Node or web design or are very averse to the command line here is this app. Because we assume you don't like the command line, we're not gonna give you the deep tools that the command line offers. But of course then we see people who like the app, but still want deeper tools, so then we go... ok, let's see how we can add some of these things without making 50 buttons on the app and confusing what we assume is a new user.
In any case, thanks for explaining your thought process. A lot of these tools are very old hat to us, and it's nice to see someone new jump into them. If you send me your site name to firstname.lastname@example.org I'll credit you with a free month for the hassle.
noob at January 9th, 2015 18:17 — #13
No hassle. It's the other way around. The documentation is good, the help is excellent, and the tools are logically laid out. It just is what it is that node is a kludge-fest throwback to the floppy disc era. Amazing what it can do, though.
I think I missed something earlier. I was trying to install the modules directly within the directory.
Correct me if I'm wrong, but what I should have been doing was to npm installing the grunt-contrib packages without cd'ing into directory (freshly opened terminal) with:
npm install grunt-contrib-xxx --save-dev
so that they are available in my system, then cd'ing into the project directory and simply typing "npm install" which then looks for the package.json file to see what needs to be installed locally (and which versions) in the node modules subdirectory.
If so, I'm almost there. I think I just need to dig into some gruntfiles to wrap my head around what their tasks are drawing from and writing to (like taking a bunch of scss partials to create a css file). Actually, since it's so easy with the app to spin up a new site, I think maybe I'll just load a few themes so I can dig in a bit and clear out the few remaining cobwebs before I make another mess. thx.
davesnider at January 9th, 2015 19:33 — #14
Personally I just go into the package.json file, add the contrib-sass package with the version number at the bottom and then run
npm install inside that site directory. Then it installs that package in that directory's node_modules directory. You can do the same thing by going to your site directory and running
npm install grunt-contrib-xxx --save-dev. That save dev part just writes the package name to the bottom of the
package.json file for you.
The only thing you don't want to do is install packages globally. That you should only be doing with first class applications that you plan to invoke in any directory... npm, wh and grunt are all things you'd want to install globally.
Welcome to Node. After the first week you realize it's a pretty smart way to do stuff. I used to work in pythong, and having to deal with virtual environments was always such a pain. I like being able to just look in my site folder and seeing what's installed.
noob at January 9th, 2015 20:51 — #15
Odd. That's exactly what I was doing to start with (the contrib/save/deb version) but it kept giving me an error saying something about package.json file already existing, then all errors from there on out. I could cd into another dir and run the install just fine.
I definitely get that it's the smart way to work. It's just awkward to interface with. I'm on a mac partly because I like knowing what all the files are on my computer, so this orphaned dependency hidden file thing makes me itch.
Hmm... on a new theme right now pouring through some other details relating to a tutorial, but I'll give it a shot with plaid npm install command tomorrow.
stoppre at January 26th, 2015 18:39 — #16
So I am running into an issue Extending Grunt as well. I believe I have everything installed properly. Although, When I open a .sass file and save it locally I am getting the following error message in terminal...
Error: File to import not found or unreadable: wyrm_core/wy_variables.
Load path: /Users/Rich/rich_matney
on line 9 of sass/app.sass
Thats without changing anything in that sass file at all....just opening and saving it to test if Grunt is checking for the sass updates...
Any help would be appreciated. Thanks!
davesnider at January 26th, 2015 18:52 — #17
Sounds like you're running one of my themes.
Make sure you run a
bower install to load in Wyrm. Assuming you are using the new solo theme, there are instructions for getting the sass to compile in the readme over here.
stoppre at July 3rd, 2015 14:33 — #19
I got this working and now all of a sudden when I save my sass file nothing happens at all. No errors at all. Any idea where I should start?
stoppre at August 12th, 2015 16:41 — #20
I still haven't been able to fix this. I backtracked and follow did the bower install. Any idea why the SASS would suddenly stop working?