简体   繁体   中英

Installing eslint in VS code - getting errors

Below is my error message when I run eslint --init in the terminal:

Checking peerDependencies of eslint-config-airbnb-base@latest
Installing eslint-config-airbnb-base@latest, eslint-plugin-import@^2.7.0
npm WARN eslint-config-airbnb-base@12.1.0 requires a peer of eslint@^4.9.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-plugin-import@2.9.0 requires a peer of eslint@2.x - 4.x but none is installed. You must install peer dependencies yourself.
npm WARN code2@1.0.0 No description
npm WARN code2@1.0.0 No repository field.

npm ERR! path C:\Users\lastF\Documents\Code2\node_modules\concat-map
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\lastF\Documents\Code2\node_modules\concat-map' -> 'C:\Users\lastF\Documents\Code2\node_modules\.concat-map.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\lastF\AppData\Roaming\npm-cache\_logs\2018-03-29T22_41_15_318Z-debug.log
Successfully created .eslintrc.js file in C:\Users\lastF\Documents\Code2

Not sure what's going on here... I tried npm install concat-map in the terminal but that also didn't work.

I was able to get around a similar problem by shutting down VS Code and running "npm uninstall eslint" followed by "npm install eslint" from the gitBash command line.

After that, I restarted VS Code and it was all good.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM