Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9189591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:16:15+00:00 2026-06-17T20:16:15+00:00

I wrote a module which I published to npm a moment ago (https://npmjs.org/package/wisp) So

  • 0

I wrote a module which I published to npm a moment ago (https://npmjs.org/package/wisp)

So it installs fine from the command line:

$ npm i -g wisp

However, when I run it from the command line, I keep getting an error that optimist isn’t installed:

$ wisp 
Error: Cannot find module 'optimist'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/wisp/wisp:12:10)
    at Object.<anonymous> (/usr/local/lib/node_modules/wisp/wisp:96:4)
    at Module._compile (module.js:449:26)
    at Object.exports.run (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:68:25)
    at compileScript (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:135:29)
    at fs.stat.notSources.(anonymous function) (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:110:18)

However, I have specified in package.json as a dependancy:

{
  "name": "wisp",
  "author": "Brendan Scarvell <bscarvell@gmail.com>",
  "version": "0.1.0",
  "description": "Global nodejs file server",
  "dependencies": {
    "optimist": "~0.3.4"
  },
  "repository": "git://github.com/tehlulz/wisp",
  "bin": {
    "wisp" : "./wisp"
  }
}

Does anyone know what to do to get this running? I know its to do with the bin part adding the executable to bin and the node_modules in that directory being empty. No idea how to resolve this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T20:16:16+00:00Added an answer on June 17, 2026 at 8:16 pm

    For anyone else running into this, I had this problem due to my npm installing into a location that’s not on my NODE_PATH.

    [root@uberneek ~]# which npm
    /opt/bin/npm
    [root@uberneek ~]# which node
    /opt/bin/node
    [root@uberneek ~]# echo $NODE_PATH
    

    My NODE_PATH was empty, and running npm install --global --verbose promised-io showed that it was installing into /opt/lib/node_modules/promised-io:

    [root@uberneek ~]# npm install --global --verbose promised-io
    npm info it worked if it ends with ok
    npm verb cli [ '/opt/bin/node',
    npm verb cli   '/opt/bin/npm',
    npm verb cli   'install',
    npm verb cli   '--global',
    npm verb cli   '--verbose',
    npm verb cli   'promised-io' ]
    npm info using npm@1.1.45
    npm info using node@v0.8.4
    [cut]
    npm info build /opt/lib/node_modules/promised-io
    npm verb from cache /opt/lib/node_modules/promised-io/package.json
    npm verb linkStuff [ true, '/opt/lib/node_modules', true, '/opt/lib/node_modules' ]
    [cut]
    

    My script fails on require('promised-io/promise'):

    [neek@uberneek project]$ node buildscripts/stringsmerge.js 
    
    module.js:340
        throw err;
              ^
    Error: Cannot find module 'promised-io/promise'
        at Function.Module._resolveFilename (module.js:338:15)
    

    I probably installed node and npm from source using configure --prefix=/opt. I’ve no idea why this has made them incapable of finding installed modules. The fix for now is to point NODE_PATH at the right directory:

    export NODE_PATH=/opt/lib/node_modules
    

    My require('promised-io/promise') now succeeds.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wrote the following module which encodes a UUID to an arbitrary base: http://pypi.python.org/pypi/shortuuid/
I wrote a custom module which I'm including with require mymodule.rb from my controller.
I wrote a module for Drupal 7 which is working fine on localhost. When
Seems only a module's missing, but I've wrote the in the package.json file, and
Please find below the directive which i wrote, angular.module('netVogue.directives', []). directive('set-First-Active', function() { return
I wrote kernel module which do nf_register_hook and use character device mechanism to get
I wrote a D6 module which provide user with the ability to communicate, config
I wrote a custom JSR-196 module, which combines multiple mechanisms to protect resources. It
I have to write a SNMP module which monitor a certain server application that
I am trying to write a MSBuild logger module which logs information when receiving

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.