Reputation: 2476
I have created a brand new ASP.NET 5 project from Visual Studio 2015 Community Edition. I check the code into a repository on BitBucket here:
https://bitbucket.org/admin_at_scanburapps/sandbox-repo
I create a new Web App on Azure and setup continuous deployment from this repository. Azure pulls out the code, start building and gives me this error:
> module.js:339
> throw err;
> ^
>
> Error: Cannot find module 'lodash'
> at Function.Module._resolveFilename (module.js:337:15)
> at Function.Module._load (module.js:287:25)
> An error has occurred during web site deployment.
> at Module.require (module.js:366:17)
> at require (module.js:385:17)
(See more output below)
I have done npm install and npm dedupe and checked in node_modules. I have also verified that lodash is indeed found under node_modules. So I'm very confused why it cannot find the lodash module.
Can anyone guess what the problem can be?
NB: The complete build log is shown here:
> Command: "D:\home\site\deployments\tools\deploy.cmd" Handling ASP.NET
> 5 Web Application deployment. 'dnx-clr-win-x86.1.0.0-rc1-update1' is
> already installed in
> D:\local\UserProfile\.dnx\runtimes\dnx-clr-win-x86.1.0.0-rc1-update1.
> Adding
> D:\local\UserProfile\.dnx\runtimes\dnx-clr-win-x86.1.0.0-rc1-update1\bin
> to process PATH Microsoft .NET Development Utility
> Clr-x86-1.0.0-rc1-16231
>
> CACHE https://api.nuget.org/v3/index.json Restoring packages for
> D:\home\site\repository\src\ScanburSandbox\project.json GET
> https://api.nuget.org/v3-flatcontainer/system.net.sockets/index.json
> OK
> https://api.nuget.org/v3-flatcontainer/system.net.sockets/index.json
> 1760ms Writing lock file
> D:\home\site\repository\src\ScanburSandbox\project.lock.json Restore
> complete, 11695ms elapsed
>
> Feeds used:
> https://api.nuget.org/v3-flatcontainer/ Microsoft .NET Development Utility Clr-x86-1.0.0-rc1-16231
>
> Executing script 'prepublish' in project.json
> - [email protected] node_modules\gulp-concat\node_modules\readable-stream npm WARN
> [email protected] No description npm WARN [email protected] No repository
> field. npm WARN [email protected] No license field. module.js:339
> throw err;
> ^
>
> Error: Cannot find module 'lodash'
> at Function.Module._resolveFilename (module.js:337:15)
> at Function.Module._load (module.js:287:25) An error has occurred during web site deployment.
> at Module.require (module.js:366:17)
> at require (module.js:385:17)
> at Object.<anonymous> (D:\home\site\repository\src\ScanburSandbox\node_modules\globule\lib\globule.js:14:9)
> at Module._compile (module.js:435:26)
> at Object.Module._extensions..js (module.js:442:10)
> at Module.load (module.js:356:32)
> at Function.Module._load (module.js:311:12)
> at Module.require (module.js:366:17)
> at require (module.js:385:17) The 'prepublish' script failed with status code 1.
I have managed to setup continuous deployment on Azure using an almost similar repository where I do not have this error. I have compared the two projects but cannot find any obvious difference explaining this error.
https://github.com/nikolaschou/TodolistService01
Upvotes: 1
Views: 319
Reputation: 13918
I removed "gulp clean", "gulp min"
commands under the "scripts"
section in project.json
file and deployed successfully from BitBucket.
You can try to remove these two commands from your code, and run them in your local project before you deploying to Azure Web Apps as a workaround.
Upvotes: 1