Error: Cannot find module 'sync-request'

159 views
Skip to first unread message

Curtis Paul

unread,
Nov 14, 2017, 12:58:39 PM11/14/17
to nodejs
var request = require('sync-request');

but when I execute the .js script I get 

Error: Cannot find module 'sync-request'

echo %NODE_PATH%
C:\Program Files\nodejs\node_modules\npm\node_modules

I've done the following...
npm init -y
npm install sync-request
npm install -g sync-request

Googled it....found all kinds of forum posts about it, but didn't find anything that helps.

I'm not a nodejs expert but I bet some of you are.

Should I be using NODE_PATH....if so is NODE_PATH set correctly?

I can do a require on ('request') at it seems to work fine....so why do some modules work and others not?
Reply all
Reply to author
Forward
0 new messages