Closed jamshark70 closed 9 years ago
On a lark, I tried npm -g install moment
which got me... another error: "Cannot find module 'underscore'"
Then, "Cannot find module 'typogr'"
And finally the preview server started.
Perhaps the package is missing some dependencies?
At this point, I can continue -- as an aside, it happens that I've had an intensely frustrating few days trying to find a static site generator that suits my needs. This beginning with wintersmith didn't do much to alleviate my frustration.
And now that I start poking around, I see in the example site's config.json:
"require": {
"moment": "moment",
"_": "underscore",
"typogr": "typogr"
},
So, either add these as dependencies, or remove them from the sample code, or document in the quick start guide that users need to install them manually to run the example site.
when you first installed wintersmith you had network connectivity issues (related to great wall of china). wintersmith and its dependencies was not properly installed. npm does have a bug/weakness where it doesn't properly check all sub-dependencies when doing an install. If it sees a folder and a package.json then it assumes that package is installed. It doesn't have a command to check if each sub-dep really was installed. solution is to trash node_modules and start again (now that you have switched VPN or used the chinese mirror that the npm people suggested)
wsmith ❯ wintersmith new ws
initializing new wintersmith site in /Users/crucial/Downloads/wsmith/ws using template blog
typogr@0.5.2 node_modules/typogr
underscore@1.4.4 node_modules/underscore
moment@2.3.1 node_modules/moment
done!
ws ❯ wintersmith preview
starting preview server
using config file: /Users/crucial/Downloads/wsmith/ws/config.json
server running on: http://localhost:8080/
note: ctrl-c is the correct and normal way to stop a process like a preview server.
btw npm -g install moment
this would install it your global ~/node_modules folder. you would want to install it only in the project you are working on. if the folder you are inside has its own node_modules folder then npm install momement
would install it there.
but in this case something went wrong with the initial installation of wintersmith and it should have automatically installed ws/package.json it did that for me.
OK, thanks.
(Yes, I found #264 which looks similar -- however, that issue was closed rapidly. Another user commented with the same error message, but #264 was not reopened. Now I have hit the same problem, so I am opening a new issue to be sure it does not get ignored.)
(Side note: At this point, the wintersmith process did not exit. I had to kill it with ctrl-c.)