Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: require(...) is not a function #16

Open
stalinkay opened this issue Apr 18, 2018 · 8 comments
Open

TypeError: require(...) is not a function #16

stalinkay opened this issue Apr 18, 2018 · 8 comments

Comments

@stalinkay
Copy link

@mdsb100 Hi. I'm getting the following error when I run gitlab projects. I'm running node v9.11.1. I had it working before so it may be due to the node version. See command output below.

/usr/local/lib/node_modules/cli-gitlab/bin/worker.js:56
      gitlab = require("gitlab")({
                                ^

TypeError: require(...) is not a function
    at requireOrGetGitlab (/usr/local/lib/node_modules/cli-gitlab/bin/worker.js:56:33)
    at Command.<anonymous> (/usr/local/lib/node_modules/cli-gitlab/bin/worker.js:242:16)
    at Command.listener (/usr/local/lib/node_modules/cli-gitlab/node_modules/commander/index.js:315:8)
    at Command.emit (events.js:180:13)
    at Command.parseArgs (/usr/local/lib/node_modules/cli-gitlab/node_modules/commander/index.js:651:12)
    at Command.parse (/usr/local/lib/node_modules/cli-gitlab/node_modules/commander/index.js:474:21)
    at Object.<anonymous> (/usr/local/lib/node_modules/cli-gitlab/bin/command.js:19:9)
    at Module._compile (internal/modules/cjs/loader.js:654:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
    at Module.load (internal/modules/cjs/loader.js:566:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
    at Function.Module._load (internal/modules/cjs/loader.js:498:3)
    at Module.require (internal/modules/cjs/loader.js:598:17)
    at require (internal/modules/cjs/helpers.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/cli-gitlab/bin/gitlab:2:1)
    at Module._compile (internal/modules/cjs/loader.js:654:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
    at Module.load (internal/modules/cjs/loader.js:566:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
    at Function.Module._load (internal/modules/cjs/loader.js:498:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)
    at startup (internal/bootstrap/node.js:201:19)
@mdsb100
Copy link
Owner

mdsb100 commented Apr 18, 2018

I will check it.

The temporary solution is:

install nvm

@stalinkay
Copy link
Author

@mdsb100 Cool. Will do that. Thanks.

@mdsb100
Copy link
Owner

mdsb100 commented Apr 18, 2018

@stalinkay
Fixed and Published

1524064180661

@mdsb100 mdsb100 closed this as completed Apr 18, 2018
@stalinkay
Copy link
Author

@mdsb100 Thanks for the update.

@stalinkay
Copy link
Author

@mdsb100 I'm still experiencing the same issue. Although it's on a different line now. My configuration is correct as well.

/usr/local/lib/node_modules/cli-gitlab/bin/worker.js:58
      gitlab = gitlabLib({
               ^

TypeError: gitlabLib is not a function
    at requireOrGetGitlab (/usr/local/lib/node_modules/cli-gitlab/bin/worker.js:58:16)
    at Command.<anonymous> (/usr/local/lib/node_modules/cli-gitlab/bin/worker.js:244:16)
    at Command.listener (/usr/local/lib/node_modules/cli-gitlab/node_modules/commander/index.js:315:8)
    at Command.emit (events.js:180:13)
    at Command.parseArgs (/usr/local/lib/node_modules/cli-gitlab/node_modules/commander/index.js:651:12)
    at Command.parse (/usr/local/lib/node_modules/cli-gitlab/node_modules/commander/index.js:474:21)
    at Object.<anonymous> (/usr/local/lib/node_modules/cli-gitlab/bin/command.js:19:9)
    at Module._compile (internal/modules/cjs/loader.js:654:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
    at Module.load (internal/modules/cjs/loader.js:566:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
    at Function.Module._load (internal/modules/cjs/loader.js:498:3)
    at Module.require (internal/modules/cjs/loader.js:598:17)
    at require (internal/modules/cjs/helpers.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/cli-gitlab/bin/gitlab:2:1)
    at Module._compile (internal/modules/cjs/loader.js:654:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
    at Module.load (internal/modules/cjs/loader.js:566:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
    at Function.Module._load (internal/modules/cjs/loader.js:498:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)
    at startup (internal/bootstrap/node.js:201:19)

@mdsb100
Copy link
Owner

mdsb100 commented Aug 13, 2018

I will refactor

@mdsb100
Copy link
Owner

mdsb100 commented Aug 14, 2018

Please take a look
https://github.com/mdsb100/node-gitlab#cli
I create a pull-request to node-gitlab. If node-gitlab does not accept it, I will publish myself by using name cli-gitlab.

@mdsb100 mdsb100 reopened this Aug 14, 2018
@mdsb100
Copy link
Owner

mdsb100 commented Aug 15, 2018

For now, you can use it locally by npm link

git clone
cd node-gitlab && npm install
npm run build
npm link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants