2

尝试创建新的 React 应用程序时出现此错误。尝试使用 npm 更新 create-react-app 并重新安装 React。

C:\Users\Panduka\Documents\tests>create-react-app markdown
path.js:33
function normalizeStringWin32(path, allowAboveRoot) {
                             ^

RangeError: Maximum call stack size exceeded
    at normalizeStringWin32 (path.js:33:30)
    at Object.resolve (path.js:338:20)
    at getRootPath (C:\Users\Panduka\AppData\Roaming\npm\node_modules\create-react-app\node_modules\fs-extra\lib\mkdirs\win32.js:6:27)
    at invalidWin32Path (C:\Users\Panduka\AppData\Roaming\npm\node_modules\create-react-app\node_modules\fs-extra\lib\mkdirs\win32.js:16:12)
    at mkdirsSync (C:\Users\Panduka\AppData\Roaming\npm\node_modules\create-react-app\node_modules\fs-extra\lib\mkdirs\mkdirs-sync.js:15:39)
    at mkdirsSync (C:\Users\Panduka\AppData\Roaming\npm\node_modules\create-react-app\node_modules\fs-extra\lib\mkdirs\mkdirs-sync.js:35:16)
    at mkdirsSync (C:\Users\Panduka\AppData\Roaming\npm\node_modules\create-react-app\node_modules\fs-extra\lib\mkdirs\mkdirs-sync.js:36:9)
    at mkdirsSync (C:\Users\Panduka\AppData\Roaming\npm\node_modules\create-react-app\node_modules\fs-extra\lib\mkdirs\mkdirs-sync.js:36:9)
    at mkdirsSync (C:\Users\Panduka\AppData\Roaming\npm\node_modules\create-react-app\node_modules\fs-extra\lib\mkdirs\mkdirs-sync.js:36:9)
    at mkdirsSync (C:\Users\Panduka\AppData\Roaming\npm\node_modules\create-react-app\node_modules\fs-extra\lib\mkdirs\mkdirs-sync.js:36:9)
4

4 回答 4

3

通过禁用 Windows Defender - 受控文件夹访问来修复此问题。

于 2018-01-23T06:56:45.593 回答
0

我今天遇到了类似的问题并修复了运行:$ npm logout

错误日志:

4268 http fetch GET 404 https://registry.npmjs.org/@xtuc%2flong 549ms
4269 silly fetchPackageMetaData error for @xtuc/long@4.2.1 404 Not Found: @xtuc/long@4.2.1
4270 verbose stack RangeError: Maximum call stack size exceeded
4270 verbose stack     at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:378:27)
4270 verbose stack     at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:396:9)
4270 verbose stack     at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:396:9)
4270 verbose stack     at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:396:9)```
于 2019-02-01T17:57:18.667 回答
0

禁用受控文件夹访问有帮助

禁用受控文件夹访问有帮助

于 2020-05-21T03:42:36.993 回答
-1

通过使用 Windows 子系统 Linux 修复了此问题。顺便说一句,我的 Windows Defender 由我的组织策略控制。

于 2019-01-21T17:50:15.117 回答