在Azure中生成错误的Node.js [英] Node.js error in Azure build

查看:157
本文介绍了在Azure中生成错误的Node.js的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建从Visual Studio 2015年社区版一个全新的ASP.NET项目5。我检查code插入到位桶的仓库在这里:

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

我创建这个仓库一个新的Web应用程序在Azure上和设置持续部署。天青翻出code,启动建设,给了我这个错误:

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)

我已经做了NPM安装和NPM重复数据删除和node_modules检查。我也已经验证了lodash确实下node_modules找到。所以我很困惑,为什么不能找到lodash模块。

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
> - readable-stream@1.0.33 node_modules\gulp-concat\node_modules\readable-stream npm WARN
> ASP.NET@0.0.0 No description npm WARN ASP.NET@0.0.0 No repository
> field. npm WARN ASP.NET@0.0.0 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.

我已经使用了几乎相同库,在这里我没有这个错误设法建立持续部署在Azure上。我比较了这两个项目,但找不到任何明显的区别解释这个错误。

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

推荐答案

我删除一口干净的,吞掉分钟下的命令 脚本 project.json 文件部分,然后从到位桶成功部署。

I removed "gulp clean", "gulp min" commands under the "scripts" section in project.json file and deployed successfully from BitBucket.

您可以尝试从code删除这两个命令,并在您的本地项目,你作为一个变通方法部署到Azure的Web应用程序之前运行它们。

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.

这篇关于在Azure中生成错误的Node.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆