Cannot find module aspnet-webpack (Angular2) #1135

Closed
opened 2025-08-09 17:19:00 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @spboyer on 1/6/2017

Created a new app and used the dotnet cli to prepare the application for deployment within a Docker container or FTP to Azure App Service (Linux)

Create generator to scaffold VS2017 version (.csproj)
run publish command to prepare app for deploy to production

dotnet publish -o app -c Release

Test app

cd app
dotnet myapp.dll

Result

Unhandled Exception: System.AggregateException: One or more errors occurred. (Call to Node module failed with error: Webpack dev middleware failed because of an error while loading 'aspnet-webpack'. Error was: Error: Cannot find module 'aspnet-webpack'
    at Function.Module._resolveFilename (module.js:440:15)
    at Function.Module._load (module.js:388:25)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/private/var/folders/gj/1mgg_4jx7mbdqbhw1kgcpcjr0000gn/T/tmpQm4YDb.tmp:83:19)
    at __webpack_require__ (/private/var/folders/gj/1mgg_4jx7mbdqbhw1kgcpcjr0000gn/T/tmpQm4YDb.tmp:20:30)
    at createWebpackDevServer (/private/var/folders/gj/1mgg_4jx7mbdqbhw1kgcpcjr0000gn/T/tmpQm4YDb.tmp:62:26)
    at /private/var/folders/gj/1mgg_4jx7mbdqbhw1kgcpcjr0000gn/T/tmpbXKtMq.tmp:113:19
    at IncomingMessage.<anonymous> (/private/var/folders/gj/1mgg_4jx7mbdqbhw1kgcpcjr0000gn/T/tmpbXKtMq.tmp:132:38)
    at emitNone (events.js:86:13)
Current directory is: /app) ---> System.Exception: Call to Node module failed with error: Webpack dev middleware failed because of an error while loading 'aspnet-webpack'. Error was: Error: Cannot find module 'aspnet-webpack'
    at Function.Module._resolveFilename (module.js:440:15)
    at Function.Module._load (module.js:388:25)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/private/var/folders/gj/1mgg_4jx7mbdqbhw1kgcpcjr0000gn/T/tmpQm4YDb.tmp:83:19)
    at __webpack_require__ (/private/var/folders/gj/1mgg_4jx7mbdqbhw1kgcpcjr0000gn/T/tmpQm4YDb.tmp:20:30)
    at createWebpackDevServer (/private/var/folders/gj/1mgg_4jx7mbdqbhw1kgcpcjr0000gn/T/tmpQm4YDb.tmp:62:26)
    at /private/var/folders/gj/1mgg_4jx7mbdqbhw1kgcpcjr0000gn/T/tmpbXKtMq.tmp:113:19
    at IncomingMessage.<anonymous> (/private/var/folders/gj/1mgg_4jx7mbdqbhw1kgcpcjr0000gn/T/tmpbXKtMq.tmp:132:38)
    at emitNone (events.js:86:13)
Current directory is: /app
   at Microsoft.AspNetCore.NodeServices.HostingModels.HttpNodeInstance.<InvokeExportAsync>d__7`1.MoveNext()
*Originally created by @spboyer on 1/6/2017* Created a new app and used the dotnet cli to prepare the application for deployment within a Docker container or FTP to Azure App Service (Linux) Create generator to scaffold VS2017 version (.csproj) run publish command to prepare app for deploy to production `dotnet publish -o app -c Release` #### Test app ``` cd app dotnet myapp.dll ``` #### Result ``` Unhandled Exception: System.AggregateException: One or more errors occurred. (Call to Node module failed with error: Webpack dev middleware failed because of an error while loading 'aspnet-webpack'. Error was: Error: Cannot find module 'aspnet-webpack' at Function.Module._resolveFilename (module.js:440:15) at Function.Module._load (module.js:388:25) at Module.require (module.js:468:17) at require (internal/module.js:20:19) at Object.<anonymous> (/private/var/folders/gj/1mgg_4jx7mbdqbhw1kgcpcjr0000gn/T/tmpQm4YDb.tmp:83:19) at __webpack_require__ (/private/var/folders/gj/1mgg_4jx7mbdqbhw1kgcpcjr0000gn/T/tmpQm4YDb.tmp:20:30) at createWebpackDevServer (/private/var/folders/gj/1mgg_4jx7mbdqbhw1kgcpcjr0000gn/T/tmpQm4YDb.tmp:62:26) at /private/var/folders/gj/1mgg_4jx7mbdqbhw1kgcpcjr0000gn/T/tmpbXKtMq.tmp:113:19 at IncomingMessage.<anonymous> (/private/var/folders/gj/1mgg_4jx7mbdqbhw1kgcpcjr0000gn/T/tmpbXKtMq.tmp:132:38) at emitNone (events.js:86:13) Current directory is: /app) ---> System.Exception: Call to Node module failed with error: Webpack dev middleware failed because of an error while loading 'aspnet-webpack'. Error was: Error: Cannot find module 'aspnet-webpack' at Function.Module._resolveFilename (module.js:440:15) at Function.Module._load (module.js:388:25) at Module.require (module.js:468:17) at require (internal/module.js:20:19) at Object.<anonymous> (/private/var/folders/gj/1mgg_4jx7mbdqbhw1kgcpcjr0000gn/T/tmpQm4YDb.tmp:83:19) at __webpack_require__ (/private/var/folders/gj/1mgg_4jx7mbdqbhw1kgcpcjr0000gn/T/tmpQm4YDb.tmp:20:30) at createWebpackDevServer (/private/var/folders/gj/1mgg_4jx7mbdqbhw1kgcpcjr0000gn/T/tmpQm4YDb.tmp:62:26) at /private/var/folders/gj/1mgg_4jx7mbdqbhw1kgcpcjr0000gn/T/tmpbXKtMq.tmp:113:19 at IncomingMessage.<anonymous> (/private/var/folders/gj/1mgg_4jx7mbdqbhw1kgcpcjr0000gn/T/tmpbXKtMq.tmp:132:38) at emitNone (events.js:86:13) Current directory is: /app at Microsoft.AspNetCore.NodeServices.HostingModels.HttpNodeInstance.<InvokeExportAsync>d__7`1.MoveNext() ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#1135
No description provided.