jsantell / poet

A node.js blog engine
jsantell.github.io/poet
MIT License
605 stars 146 forks source link

`npm install -g poet` doesn't? #124

Open mcarifio opened 7 years ago

mcarifio commented 7 years ago

I'm a node n00b here, so this might be pilot error:

root@shuttle:~# npm list -g poet                        
/usr/lib                                                
└── poet@2.0.2                                          

root@shuttle:~# node --version                          
v8.6.0                                                  
root@shuttle:~# node                                    
> require('poet');                                      
Error: Cannot find module 'poet'                        
    at Function.Module._resolveFilename (module.js:527:15)                                                       
    at Function.Module._load (module.js:476:23)         
    at Module.require (module.js:568:17)                
    at require (internal/module.js:11:18)               
    at repl:1:1                                         
    at ContextifyScript.Script.runInThisContext (vm.js:50:33)                                                    
    at REPLServer.defaultEval (repl.js:239:29)          
    at bound (domain.js:301:14)                         
    at REPLServer.runBound [as eval] (domain.js:314:12) 
    at REPLServer.onLine (repl.js:440:10)               

I was expecting node to successfully find poet@2.0.2.

Please advise. Thanks.

ChrisMcKenzie commented 7 years ago

I see the same issue, I am digging into a solution for this right now!

ChrisMcKenzie commented 7 years ago

Ok, I was able to get it to import once I made sure node is looking in the right path can you try setting the NODE_PATH env var to include the path listed in your previous list call (/usr/lib/node_modules).

So you would echo NODE_PATH=$NODE_PATH:/usr/lib/node_modules