verbose / verb-generate-readme

Generate your project's readme with verb. Requires verb v0.9.0 or higher.
MIT License
162 stars 13 forks source link

`Path must be a string` error on `verb readme` #7

Closed vjpr closed 8 years ago

vjpr commented 8 years ago
> verb readme

path.js:7
    throw new TypeError('Path must be a string. Received ' + inspect(path));
    ^

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.dirname (path.js:1324:5)
    at Liftoff.run (/Users/Vaughan/nvm/versions/node/v6.0.0/lib/node_modules/verb-cli/bin/verb.js:133:27)
vjpr commented 8 years ago
  // `verbfile.js`
  if ((hasVerbmd && !hasVerbfile) || !verbfile) {
    verbfile = resolve.sync('verb-default');
    console.log(env)
    env.configBase = path.dirname(env.configBase);
    require(verbfile)(verbInst);
  } else {
    // this is what actually loads up the verbfile
    require(verbfile);
  }

Seems to be caused if no verbfile.js is present.

But now I get

Error: Invalid task `readme`. Register `readme` before calling run.
> npm ls -g --depth=0

├── verb@0.8.10
├── verb-cli@0.7.4
├── verb-readme-generator@0.1.12
jonschlinkert commented 8 years ago

Sorry this needs to be up front on the readme (I didn't realize it wasn't until now). To run this generator you need to install the dev branch of verb. I'm working on getting that branch published, hopefully today.

vjpr commented 8 years ago
npm i -g verbose/verb#dev
npm i -g verb-readme-generator
Error: Cannot find module 'time-stamp'
    at Function.Module._resolveFilename (module.js:438:15)
    at Function.Module._load (module.js:386:25)
    at Module.require (module.js:466:17)
    at require (internal/module.js:20:19)
    at Function.getter [as timeStamp] (/Users/Vaughan/nvm/versions/node/v6.0.0/lib/node_modules/verb/node_modules/ansi-colors/node_modules/lazy-cache/index.js:39:29)
    at Function.timestamp (/Users/Vaughan/nvm/versions/node/v6.0.0/lib/node_modules/verb/node_modules/base-runner/node_modules/log-utils/index.js:165:32)
    at Function.utils.timestamp (/Users/Vaughan/nvm/versions/node/v6.0.0/lib/node_modules/verb/node_modules/base-runner/utils.js:80:25)
    at runner (/Users/Vaughan/nvm/versions/node/v6.0.0/lib/node_modules/verb/node_modules/base-runner/index.js:95:9)
    at Object.<anonymous> (/Users/Vaughan/nvm/versions/node/v6.0.0/lib/node_modules/verb/bin/verb.js:21:1)
    at Module._compile (module.js:541:32)
jonschlinkert commented 8 years ago

that error happens all the time with npm. you need to run npm i again, or do npm cache clean then npm i again. if that doesn't work, try removing node_modules and install again.

vjpr commented 8 years ago

I tried all of your suggestions. Still encountering this issue.

lazy-cache@0.2.7 is what is installed and it does not depend on time-stamp in its package.json.

vjpr commented 8 years ago

I'm finding it difficult to debug...lots of magic going on.

base-runner/node_modules/log-utils

var utils = require('ansi-colors');

...

define(utils, 'timestamp', function() {
  return '[' + utils.gray(utils.timeStamp('HH:mm:ss')) + ']';
});

ansi-colors

var colors = require('lazy-cache')(require);

etc.

jonschlinkert commented 8 years ago

lots of magic going on.

Sorry for the late reply. What kind of magic? The code is pretty transparent. Or do you just mean "dependencies"

jonschlinkert commented 8 years ago

closing based on lack of response. I suggest reading the node.js documentation to learn how "the magic" of modules and debugging work.