簡體   English   中英

Azure Web Node.js 項目服務部署失敗

[英]Azure Web Service Deployment fails for Node.js project

將我們的 Vue.js 項目部署到 Azure Web 服務時,我遇到了一個奇怪的問題。 首先:設置完美運行,我可以訪問 Web 服務,我面臨的唯一問題是部署失敗。 當我在本地使用npm run serve啟動應用程序時,一切正常,但我收到大量錯誤,例如82:18 Property 'load' does not exist on type 'Vue'. .

我們暫時忽略這些錯誤,因為load是存在的,我們可以正常使用它,沒有找到解決這些錯誤的方法。 因此,問題是:這些錯誤(即使顯示的錯誤標記了我們使用的並且有效的東西)是否會導致部署失敗?

部署的最后一行如下:

2021-06-23T15:09:46.095Z - npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.1 (node_modules/webpack/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/webpack-dev-server/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/watchpack-chokidar2/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.1 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/fork-ts-checker-webpack-plugin/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

-  Building for production...
 ERROR  Build failed with errors.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! project@0.1.0 build: `vue-cli-service build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the project@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/.npm/_logs/2021-06-23T15_09_29_048Z-debug.log
/opt/Kudu/Scripts/starter.sh oryx build /home/site/repository -o /home/site/wwwroot --platform nodejs --platform-version 14 -i /tmp/8d93658061b46ee -p compress_node_modules=tar-gz --log-file /tmp/build-debug.log 

老實說,我不知道如何處理這個巨大的錯誤。 我四處搜索了一下,但沒有找到合適的解決方案。


我嘗試在本地運行npm run build (謝謝@polmonite),我在 npm 緩存中的錯誤日志現在如下所示:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'build' ]
2 info using npm@6.4.1
3 info using node@v8.12.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle myProject@0.1.0~prebuild: myProject@0.1.0
6 info lifecycle myProject@0.1.0~build: myProject@0.1.0
7 verbose lifecycle myProject@0.1.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle myProject@0.1.0~build: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\***\node_modules\.bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Git\cmd;C:\Program Files\dotnet\;C:\Program Files\nodejs\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\CMake\bin;C:\Users\***\AppData\Local\Programs\Python\Python39\Scripts\;C:\Users\***\AppData\Local\Programs\Python\Python39\;C:\Users\***\AppData\Local\Microsoft\WindowsApps;C:\Users\***\AppData\Roaming\npm;C:\Users\***\.dotnet\tools;C:\Users\***\AppData\Local\Microsoft\WindowsApps;C:\Users\***\.dotnet\tools;C:\Users\***\AppData\Local\Programs\Microsoft VS Code\bin;
9 verbose lifecycle myProject@0.1.0~build: CWD: C:\Users\***\myProject
10 silly lifecycle myProject@0.1.0~build: Args: [ '/d /s /c', 'vue-cli-service build' ]
11 silly lifecycle myProject@0.1.0~build: Returned: code: 1  signal: null
12 info lifecycle myProject@0.1.0~build: Failed to exec build script
13 verbose stack Error: myProject@0.1.0 build: `vue-cli-service build`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at EventEmitter.emit (events.js:214:7)
13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at ChildProcess.emit (events.js:214:7)
13 verbose stack     at maybeClose (internal/child_process.js:915:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid myProject@0.1.0
15 verbose cwd C:\Users\***\Git\myProject
16 verbose Windows_NT 10.0.19042
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
18 verbose node v8.12.0
19 verbose npm  v6.4.1
20 error code ELIFECYCLE
21 error errno 1
22 error myProject@0.1.0 build: `vue-cli-service build`
22 error Exit status 1
23 error Failed at the myProject@0.1.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

我遇到過類似的問題,這可能對您沒有幫助,但是您是否檢查過您的應用服務計划的容量? 如果您使用的是免費套餐(1GB 的可用內存),那么您的項目(當然包括 node_modules)的大小不應超過 1GB 的限制。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM