gpt4 book ai didi

reactjs - React js SyntaxError Occurs in Node Modules webpack chokidar.js 'return' out of function (4 :2)

转载 作者:行者123 更新时间:2023-12-04 11:37:26 26 4
gpt4 key购买 nike

我从昨天开始就面临这个问题.. 无解 对于此错误,下面提到了完整的错误日志

var v3Err;
try {
module.exports = require("chokidar");
return;
} catch(e) {
v3Err = e;
}

函数外的“返回”发生错误 (4:2)
SyntaxError: E:\test\node_modules\watchpack\lib\chokidar.js: 'return' 函数外 (4:2)
在 Object._raise (E:\test\node_modules@babel\parser\src\parser\error.js:60:45)
在 Object.raiseWithData (E:\test\node_modules@babel\parser\src\parser\error.js:55:17)
在 Object.raise (E:\test\node_modules@babel\parser\src\parser\error.js:39:17)
在 Object.parseReturnStatement (E:\test\node_modules@babel\parser\src\parser\statement.js:563:12)
在 Object.parseStatementContent (E:\test\node_modules@babel\parser\src\parser\statement.js:197:21)
在 Object.parseStatement (E:\test\node_modules@babel\parser\src\parser\statement.js:151:17)
在 Object.parseBlockOrModuleBlockBody (E:\test\node_modules@babel\parser\src\parser\statement.js:873:25)
在 Object.parseBlockBody (E:\test\node_modules@babel\parser\src\parser\statement.js:843:10)
在 Object.parseBlock (E:\test\node_modules@babel\parser\src\parser\statement.js:813:10)
在 Object.parseStatementContent (E:\test\node_modules@babel\parser\src\parser\statement.js:218:21)
npm 错误!代码生命周期
npm 错误!错误号 1
npm 错误! forbes-me@1.0.0 开始: pawjs --no-cache --config=./pawconfig.json --env=development startnpm 错误!退出状态 1
npm 错误!
npm 错误!在 forbes-me@1.0.0 启动脚本失败。
npm 错误!这可能不是 npm 的问题。上面可能有额外的日志输出。
npm 错误!可以在以下位置找到此运行的完整日志:
npm 错误! C:\Users\glowlogix\AppData\Roaming\npm-cache_logs\2020-08-17T09_19_41_742Z-debug.log

最佳答案

我在我的项目中遇到了同样的问题。自动完成(由于拼写错误)自动向我的文件添加了一个导入。当我删除它时,我的问题就解决了。所以我建议你检查你的模块是否有不必要的导入。
example of my auto added import

关于reactjs - React js SyntaxError Occurs in Node Modules webpack chokidar.js 'return' out of function (4 :2),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63448436/

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