generate-package icon indicating copy to clipboard operation
generate-package copied to clipboard

gen package or gen help throws error

Open ritwik2finda opened this issue 9 years ago • 5 comments

I am a newbie, please help. I just installed Node.js v6.9.1 on my windows machine

npm install --global generate and npm install --global generate-package were successful.

When I fire gen package or gen help it throws the following error:

C:\>gen help
[20:51:35] starting generate
[20:51:35] √ running tasks: [ 'defaults:help' ]
path.js:7
    throw new TypeError('Path must be a string. Received ' + inspect(path));
    ^

TypeError: Path must be a string. Received null
    at assertPath (path.js:7:11)
    at Object.resolve (path.js:186:7)
    at Function.resolve (C:\Users\admin\AppData\Roaming\npm\node_modules\generate\node_modules\parse-git-config\index.js
:116:15)
    at Function.parseSync [as sync] (C:\Users\admin\AppData\Roaming\npm\node_modules\generate\node_modules\parse-git-con
fig\index.js:79:24)
    at Schema.module.exports (C:\Users\admin\AppData\Roaming\npm\node_modules\generate\node_modules\expand-pkg\lib\expan
ders\git.js:13:36)
    at Schema.normalizeField (C:\Users\admin\AppData\Roaming\npm\node_modules\generate\node_modules\map-schema\index.js:
557:16)
    at Schema.update (C:\Users\admin\AppData\Roaming\npm\node_modules\generate\node_modules\map-schema\index.js:246:8)
    at Schema.module.exports (C:\Users\admin\AppData\Roaming\npm\node_modules\generate\node_modules\expand-pkg\lib\expan
ders\owner.js:14:10)
    at Schema.normalizeField (C:\Users\admin\AppData\Roaming\npm\node_modules\generate\node_modules\map-schema\index.js:
557:16)
    at Schema.normalize (C:\Users\admin\AppData\Roaming\npm\node_modules\generate\node_modules\map-schema\index.js:497:2
7)

ritwik2finda avatar Oct 27 '16 03:10 ritwik2finda

It looks like a bug, I believe it's failing because it can't find a local or global git config path. I might have just fixed the root cause of this last night, but I'll need to update the underlying modules in generate before you receive the benefit of that fix.

Thanks for reporting, and I'm really sorry you had this as your first experience with generate. I'll update here after I make the necessary change.

jonschlinkert avatar Oct 27 '16 04:10 jonschlinkert

Thank you. Please let me know once done. In the mean time is there a work-around for this?

ritwik2finda avatar Oct 28 '16 02:10 ritwik2finda

It might be resolved if you install git. Unless git is already installed, in which case I'm wrong about what's causing it

jonschlinkert avatar Oct 28 '16 02:10 jonschlinkert

Git is already installed. It had thrown a different error when I had a problem with git. I was able to resolve it by reinstalling git. And git is setup in the PATH variable as well

ritwik2finda avatar Oct 28 '16 04:10 ritwik2finda

Hmm, I wasn't able to reproduce this on mac or windows. I'm not sure what's causing it, but I'll leave this open in case anyone else encounters the issue.

jonschlinkert avatar Dec 10 '16 10:12 jonschlinkert