express app cannot find module 'hamljs'
wsvekla opened this issue · comments
install of hamljs (v0.5.2) with npm (v1.1.0-beta4) on node (v0.6.6) windows (v7) looks fine but application with:
// Use hamljs for HAML views
app.register('.haml', require('hamljs'));
returns error: Cannot find module 'hamljs'
that's just a require() error, so maybe you didnt install it properly. add it to your package.json deps
and npm install
i have used npm to install everything and have tried with both local and global installs
npm ls prints:
application-name@0.0.1 c:\nodejs\applications\application
express@2.5.2
connect@1.8.3
formidable@1.0.8
mime@1.2.4
mkdirp@0.0.7
qs@0.4.0
haml@0.4.2 extraneous
hamljs@0.4.5 extraneous
jade@0.19.0
commander@0.2.1
mkdirp@0.2.1
pg@0.6.8 extraneous
generic-pool@1.0.7
i will follow your suggestion to add to package.json deps and npm install
adding to package.json dependency and then "npm install" makes no difference. I also noticed that pg is not in my package.json file (and the require code throws no errors); however, "npm install" results in:
pg@0.6.8 install c:\nodejs\applications\app\node_modules\pg
node-waf configure build || true
'node-waf' is not recognized as an internal or external command,
operaable program or batch file.
so the local "npm install" for pg seemed to work but not for hamljs
ok so if i even just create a new fresh out of the box express application at c:\nodejs\applications\haml by running:
c:\nodejs\applications\haml express
and then
npm install
and then
npm install hamljs
and then run app.js that has the lines:
// Use hamljs for HAML views
app.register('.haml', require('hamljs'));
i still get the error
Error: Cannot find module 'hamljs'
this is what my package.json file looks like:
{
"name": "application-name"
, "version": "0.0.1"
, "private": true
, "dependencies": {
"express": "2.5.2"
, "jade": ">= 0.0.1"
}
}
is it a npm problem or a hamljs problem that it can't be found? do i need to take different steps for this package than i do for other packages?