小编Pio*_*trP的帖子

迁移到最新的 Angular 版本后,无法解析“fs”和字段“浏览器”不包含有效的别名配置错误

将项目从 Angular 8 迁移到 10 版本后,我在运行单元测试时收到以下错误:

ERROR in ./node_modules/fs.realpath/index.js
Module not found: Error: Can't resolve 'fs' in 'C:\Users\pp\Desktop\gns3-web-ui\node_modules\fs.realpath'
resolve 'fs' in 'C:\Users\pp\Desktop\gns3-web-ui\node_modules\fs.realpath'
  Parsed request is a module
  using description file: C:\Users\pp\Desktop\gns3-web-ui\node_modules\fs.realpath\package.json (relative path: .)
    Field 'browser' doesn't contain a valid alias configuration
    resolve as module
      looking for modules in C:/Users/pp/Desktop/gns3-web-ui/src
        using description file: C:\Users\pp\Desktop\gns3-web-ui\package.json (relative path: ./src)
          Field 'browser' doesn't contain a valid alias configuration
          using description file: C:\Users\pp\Desktop\gns3-web-ui\package.json (relative path: ./src/fs)
            no extension
              Field 'browser' doesn't contain a valid …
Run Code Online (Sandbox Code Playgroud)

javascript unit-testing jasmine typescript angular

6
推荐指数
0
解决办法
3721
查看次数

为什么我的变量在 erlang try 中不安全?

我是 Erlang 的新手。我对下面的代码有问题:

try
    {ok, [Card]} = io:fread("Input card number: ","~d")
    catch
      error:K -> (Card=0);
      exit:K -> (Card=0);
      throw:K -> (Card=0)
    end,
Run Code Online (Sandbox Code Playgroud)

我不知道为什么“尝试”中的“变量”卡不安全。我该怎么办?

erlang exception

2
推荐指数
1
解决办法
640
查看次数