[INFO] Installing dependencies... [ERROR] Error: Cannot find module 'npm'

1,586 views
Skip to first unread message

Fokke Zandbergen

unread,
Dec 31, 2012, 8:20:41 AM12/31/12
to node...@googlegroups.com
I created a new Node.ACS Service for an existing (Alloy) app in Titanium Studio. I've added the following dependency:

  "dependencies": {
  "node-request-caching": "*"
  },

Now if I try to run it locally I get the following in my console:

[INFO]  Installing dependencies...
[ERROR] Error: Cannot find module 'npm'

I do have npm installed. Do I need to set the path in Titanium Studio somewhere?

Wei Kong

unread,
Dec 31, 2012, 9:04:41 AM12/31/12
to node...@googlegroups.com

Are you on windows? You can try to set npm in your node path or try adding npm to dependency. Are you using the latest npm 0.9.27?
--
 
 

Fokke Zandbergen

unread,
Dec 31, 2012, 10:06:10 AM12/31/12
to node...@googlegroups.com
No, I'm on a Mac and npm -v gives 1.1.59 actually. I also did export NODE_PATH="/usr/local/lib/node" already so I've no idea why I get:

fokke$ acs run

      _/_/      _/_/_/    _/_/_/ 
   _/    _/  _/        _/        
  _/_/_/_/  _/          _/_/     
 _/    _/  _/              _/    
_/    _/    _/_/_/  _/_/_/       

[DEBUG] dependency => node-request-caching@*
Message has been deleted

Fokke Zandbergen

unread,
Dec 31, 2012, 1:44:52 PM12/31/12
to node...@googlegroups.com
I did run "npm install" in the project and it did install node-request-caching that way. I think there's something else wrong since it looks for a 'npm' module.

Op 31 dec. 2012, om 16:41 heeft Alan Wamser <al...@wamser.com> het volgende geschreven:

After use add any dependencies, you'll still need to do an npm install from the project directory.
--
 
 

Wei Kong

unread,
Dec 31, 2012, 4:30:47 PM12/31/12
to node...@googlegroups.com
Did you get it working ? Have you tried adding npm in your package.json dependency list
--
 
 

jiny...@gmail.com

unread,
May 27, 2013, 4:08:36 AM5/27/13
to node...@googlegroups.com
Depending on the location of your global node_modules folder you may need to do
export NODE_PATH='/usr/local/lib/node_modules'

zkf...@gmail.com

unread,
Feb 27, 2015, 3:50:55 AM2/27/15
to node...@googlegroups.com
Awesome, find you here. the solution saves my life:)
Reply all
Reply to author
Forward
0 new messages