Error: Cannot find module '../lib/cli'
See original GitHub issueI 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:
- Created 7 years ago
- Comments:15 (8 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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 ofbin/eslint.js
. Then when you run eslint, it tries torequire('../lib/cli')
relative tonode_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
andnpm test
there): https://github.com/LLK/eslint-config-scratch. I’m using npm v3.10.8.