question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Cannot find module '../lib/cli'

See original GitHub issue

I am using eslint v3.3.1 with Sublime text 3 to develop my react web app. Currently I encounter an error say :

Error: Cannot find module '../lib/cli'
    at Function.Module._resolveFilename (module.js:455:15)
    at Function.Module._load (module.js:403:25)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/Welly/Dropbox/GitHub/react-universal-starter/node_modules/.bin/eslint:29:11)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3) 

And when I remove and re-install node_modules, this error seems to be solved, but next time I launch my code editor this error occurs again, does anyone has this problem?

Here’s my .eslintrc :

{
  "parser": "babel-eslint",
  "extends": "airbnb",
  "plugins": [
    "react"
  ],
  "env": {
    "es6": true,
    "browser": true,
    "node": true
  },
  "rules": {
    "global-require": 0,
    "no-underscore-dangle": 0,
    "no-console": 0,
    "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }]
  },
  "globals": {
    "__DEV__": true,
    "webpackIsomorphicTools": true
  }
}

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

5reactions
rschampcommented, Dec 2, 2016

Yes, it does occur with other modules. After I posted that, the same thing happened with tap. The thing is that I only use Dropbox for backup, I don’t use the syncing behavior on multiple computers, and yet Dropbox apparently destroys the symlinks even then.

Even more annoying to me after some Googling to see that Dropbox has had this issue for years and years. Ironic because a lot of their user base must be developers.

3reactions
rschampcommented, Nov 24, 2016

This happens to me and my team occasionally — the root cause seems to be that somewhere along the line node_modules/.bin/eslint has become a real file, a copy of bin/eslint.js. Then when you run eslint, it tries to require('../lib/cli') relative to node_modules/.bin/ which crashes with this error. Uninstalling and reinstalling eslint fixes the issue, as it fixes .bin/eslint to be a symlink again, but I wonder if some combination of dependencies causes this to happen?

This just happened to me while working on this repo (i.e. running npm install and npm test there): https://github.com/LLK/eslint-config-scratch. I’m using npm v3.10.8.

Read more comments on GitHub >

github_iconTop Results From Across the Web

76 - Stack Overflow
Error : Cannot find module '../lib/cli' ; Users/noahc/Projects ; js module.js ; 340 throw err; ^ Error ...
Read more >
Issues - GitHub
Error : Cannot find module './lib/cli/cli' Require stack: /ms-playwright-agent/node_modules/playwright-core/cli.js at Function.Module.
Read more >
lib.cli - npm
Start using lib.cli in your project by running `npm i lib.cli`. There are no other projects in the npm registry using lib.cli.
Read more >
Sign in - YouTube
JavaScript : Error : Cannot find module '../ lib/cli ' [ Gift : Animated Search Engine : https://bit.ly/AnimSearch ] JavaScript : Error: Cannot ......
Read more >
Npm install not working. Cannot find module npm-cli.js
I'm getting the following error Error: Cannot find module 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js' In fact the bin ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found