我正在使用 .Net core 2.0.3 和 3rd 方包。使用“dotnet publish”命令时出现以下错误。

适用于 .NET Core 的 Microsoft (R) 构建引擎版本 15.4.8.50001
版权所有 (C) 微软公司。版权所有。

WebApplication6 -> D:\incident\WebApp_95367a2a\bin\Debug\netcoreapp2.0\WebApplication6.dll
npm WARN 可选跳过可选依赖:[email protected] (node_modules\fsevents):
npm WARN notsup 跳过可选依赖项:[email protected] 不受支持的平台:想要 {"os":"darwin","arch":"any"}(当前:{"os":"win32","arch": "x64"})

在 17.679 秒内添加了 116 个包
哈希:8dde8c59d57adf41d181f75d6401e1c57572e1e2
版本:webpack 2.5.1
child
哈希:8dde8c59d57adf41d181
时间:50549ms
Assets 大小块块名称
89889688147bd7575d6327160d64e760.svg 109 kB [已发出]
4dc129540072fa1a1317a8dbeee744f7.svg 146 kB [已发出]
c848e0404000287e4fd9d523dd8345e3.svg 264 kB [emitted] [big]
vendor.js 194 kB 0 [发出] 供应商
vendor.css 2.69 MB 0 [emitted] [big] vendor
child
哈希:f75d6401e1c57572e1e2
时间:50650ms
Assets 大小块块名称
89889688147bd7575d6327160d64e760.svg 109 kB [已发出]
4dc129540072fa1a1317a8dbeee744f7.svg 146 kB [已发出]
c848e0404000287e4fd9d523dd8345e3.svg 264 kB [emitted] [big]
vendor.js 5.62 MB 0 [emitted] [big] 供应商
哈希:4adcf6db79fc4d90effdc8259013a005d149ec9e
版本:webpack 2.5.1
child
哈希:4adcf6db79fc4d90effd
时间:19523ms
Assets 大小块块名称
main-client.js 268 kB 0 [emitted] [big] 主客户端

  ERROR in ./ClientApp/boot.browser.ts

找不到模块:错误:无法解析“D:\incident\WebApp_95367a2a\ClientApp”中的“./../$$_gendir/ClientApp/app/app.browser.module.ngfactory”[D:\incident\WebApp_95367a2a\WebApplication6.csproj]
@ ./ClientApp/boot.browser.ts 5:0-95
child
哈希:c8259013a005d149ec9e
时间:19525ms
Assets 大小块块名称
main-server.js 1.81 MB 0 [emitted] [big] 主服务器
  ERROR in ./ClientApp/boot.server.ts

找不到模块:错误:无法解析“D:\incident\WebApp_95367a2a\ClientApp”中的“./../$$_gendir/ClientApp/app/app.server.module.ngfactory”[D:\incident\WebApp_95367a2a\WebApplication6.csproj]
@ ./ClientApp/boot.server.ts 8:0-94
D:\incident\WebApp_95367a2a\WebApplication6.csproj(41,5):错误 MSB3073:命令“node node_modules/webpack/bin/webpack.js --env.prod”退出,代码为 2。

最佳答案

我遇到了同样的错误,我重命名了 boot.browse.ts 和 boot.serve.ts 之类的文件,然后运行 ​​dotnet restore src/yourprojectname.sin 。如果你这样做,我认为它会得到另一个错误,比如 webpack 问题(你的项目使用 webpack)。这会很容易

关于.net - ./ClientApp/boot.server.ts 模块中的错误未找到 : error : Can't resolve './../$$_gendir/ClientApp/app/app.server.module.ngfactory' ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/47712165/

10-12 15:10