创建React App:范围错误 - 超出最大调用堆栈大小

时间:2018-01-22 17:21:06

标签: reactjs create-react-app

我在尝试创建新的反应应用时遇到此错误。 尝试使用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 个答案:

答案 0 :(得分:2)

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

答案 1 :(得分: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)```

答案 2 :(得分:0)

帮助禁用受控文件夹访问

Disabling Controlled Folder access helped

答案 3 :(得分:-1)

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