gpt4 book ai didi

javascript - 初始化时 Eslint 错误!针对爱彼迎标准运行 'eslint --init' 时,JSON 中位置 139 处出现意外 token {

转载 作者:行者123 更新时间:2023-12-01 00:17:46 26 4
gpt4 key购买 nike

我在运行 eslint init 时收到此错误,它似乎不是由我的任何文件触发的,而是由它自己的代码触发的。我在另一个网站上看到有人有同样的错误消息。我尝试卸载并重新安装并尝试旧版本但无济于事。

oem@Trevor:~/signal-labs-nodejs-coding-challenege$ eslint --init
? How would you like to use ESLint? To check syntax, find problems, and enforce code style
? What type of modules does your project use? JavaScript modules (import/export)
? Which framework does your project use? None of these
? Does your project use TypeScript? No
? Where does your code run? Browser, Node
? How would you like to define a style for your project? Use a popular style guide
? Which style guide do you want to follow? Airbnb: https://github.com/airbnb/javascript
? What format do you want your config file to be in? JavaScript
Checking peerDependencies of eslint-config-airbnb-base@latest
Unexpected token { in JSON at position 139
SyntaxError: Unexpected token { in JSON at position 139
at JSON.parse (<anonymous>)
at Object.fetchPeerDependencies (/usr/local/lib/node_modules/eslint/lib/init/npm-utils.js:83:17)
at getPeerDependencies (/usr/local/lib/node_modules/eslint/lib/init/config-initializer.js:81:27)
at hasESLintVersionConflict (/usr/local/lib/node_modules/eslint/lib/init/config-initializer.js:388:30)
at Object.when (/usr/local/lib/node_modules/eslint/lib/init/config-initializer.js:568:83)
at /usr/local/lib/node_modules/eslint/node_modules/run-async/index.js:25:25
at new Promise (<anonymous>)
at /usr/local/lib/node_modules/eslint/node_modules/run-async/index.js:24:19
at /usr/local/lib/node_modules/eslint/node_modules/inquirer/lib/ui/prompt.js:114:32
at Observable._subscribe (/usr/local/lib/node_modules/eslint/node_modules/rxjs/internal/observable/defer.js:10:21)

最佳答案

就我而言,这是由于我的项目中存在旧版本的 Node 造成的。更新 Node 版本为我解决了这个问题。

关于javascript - 初始化时 Eslint 错误!针对爱彼迎标准运行 'eslint --init' 时,JSON 中位置 139 处出现意外 token {,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59646571/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com