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

[github] Error: Cannot find module 'github' #12

Open
dodouwang opened this issue May 8, 2018 · 9 comments
Open

[github] Error: Cannot find module 'github' #12

dodouwang opened this issue May 8, 2018 · 9 comments

Comments

@dodouwang
Copy link

:~/leetcode$ leetcode push 106.construct-binary-tree-from-inorder-and-postorder-traversal.153319531.notac.cpp -vv
[TRACE] initializing all plugins
[TRACE] found plugin: cache=default
[TRACE] inited plugin: cache
[TRACE] found plugin: company=2017.12.18
[TRACE] inited plugin: company
[TRACE] found plugin: cpp.run=2017.07.29
[TRACE] inited plugin: cpp.run
[TRACE] found plugin: github=2018.03.24
[TRACE] inited plugin: github
[TRACE] found plugin: leetcode=default
[TRACE] inited plugin: leetcode
[TRACE] found plugin: retry=default
[TRACE] inited plugin: retry
[TRACE] found plugin: solution.discuss=2018.04.14
[TRACE] inited plugin: solution.discuss
[TRACE] missing plugins: 0
[DEBUG] cache hit: problems.json
[DEBUG] cache hit: 106.construct-binary-tree-from-inorder-and-postorder-traversal.algorithms.json
/usr/local/lib/node_modules/leetcode-cli/node_modules/yargs/yargs.js:1100
else throw err
^

Error: Cannot find module 'github'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Plugin.plugin.submitProblem (/usr/local/lib/node_modules/leetcode-cli/lib/plugins/github.js:29:19)
at /usr/local/lib/node_modules/leetcode-cli/lib/commands/submit.js:58:10
at /usr/local/lib/node_modules/leetcode-cli/lib/plugins/solution.discuss.js:81:45
at Plugin.plugin.getProblem (/usr/local/lib/node_modules/leetcode-cli/lib/plugins/cache.js:38:12)
at Plugin.plugin.getProblem (/usr/local/lib/node_modules/leetcode-cli/lib/plugins/solution.discuss.js:80:15)
at /usr/local/lib/node_modules/leetcode-cli/lib/core.js:95:15

@skygragon
Copy link
Owner

try to reinstall github plugin?

leetcode plugin -i github

@dodouwang
Copy link
Author

dodouwang commented May 9, 2018 via email

@skygragon
Copy link
Owner

The log shows you are missing a 3rd party library that leetcode-cli needed, which is called "github" as well. Please check if it exists or not:

# ls /usr/local/lib/node_modules/leetcode-cli/node_modules/github/
LICENSE      README.md    lib          package.json

Weird that leetcode plugin -i github should always install this 3rd party library automatically...

@cosmozhang
Copy link

I met the exact same problem.

@cosmozhang
Copy link

Fixed, need to use sudo

@skygragon
Copy link
Owner

@cosmozhang which version of npm do u use? Newer versions should not require sudo any more.

@cosmozhang
Copy link

5.6

@liangjiezhu
Copy link

same error. npm 6.9

@hellosp
Copy link

hellosp commented May 9, 2019

I solved this problem by using "sudo leetcode plugin -i github"

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

No branches or pull requests

5 participants