Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building fails because of missing node_modules #348

Closed
janekkkk opened this issue Sep 12, 2019 · 13 comments
Closed

Building fails because of missing node_modules #348

janekkkk opened this issue Sep 12, 2019 · 13 comments

Comments

@janekkkk
Copy link

janekkkk commented Sep 12, 2019

Building fails because of missing node_modules

I'm setting up a CI/CD pipeline with Azure Devops. When the Nuxt Universal (Node) application gets build by my pipeline everything goes well. However when Oryx builds the application it's missing modules.

I wasn't expecting it to build again as I've already build it and added the zip for deployment. I'm quite new with Azure Devops however so correct me if I'm wrong.

Here's some screenshots of my Azure devops build/release pipeline.

2019-09-11T18:09:49.1204732Z ##[section]Starting: Deploy Azure App Service
2019-09-11T18:09:49.1336280Z ==============================================================================
2019-09-11T18:09:49.1336365Z Task         : Azure App Service deploy
2019-09-11T18:09:49.1336441Z Description  : Deploy to Azure App Service a web, mobile, or API app using Docker, Java, .NET, .NET Core, Node.js, PHP, Python, or Ruby
2019-09-11T18:09:49.1336496Z Version      : 4.157.0
2019-09-11T18:09:49.1336556Z Author       : Microsoft Corporation
2019-09-11T18:09:49.1336611Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/deploy/azure-rm-web-app-deployment
2019-09-11T18:09:49.1336695Z ==============================================================================
2019-09-11T18:09:49.8740356Z Got service connection details for Azure App Service:'browsy-landingpage'
2019-09-11T18:09:50.6489318Z Package deployment using ZIP Deploy initiated.
2019-09-11T18:19:45.1726225Z Updating submodules.
2019-09-11T18:19:45.1727554Z Preparing deployment for commit id 'fc0cb5fdce'.
2019-09-11T18:19:45.1728565Z Oryx-Build: Running kudu sync...
2019-09-11T18:19:45.4588879Z Command: kudusync -v 50 -f /tmp/zipdeploy/extracted -t /home/site/wwwroot -n /home/site/deployments/fc0cb5fdce89454385873bdebd7b7b46/manifest -p /home/site/deployments/481568147692981/manifest -i ".git;.hg;.deployment;.deploy.sh"
2019-09-11T18:19:45.4589183Z Kudu sync from: '/tmp/zipdeploy/extracted' to: '/home/site/wwwroot'
2019-09-11T18:19:45.4589428Z Copying file: '.babelrc'
2019-09-11T18:19:45.4589531Z Ignoring: .deployment
2019-09-11T18:19:45.4589771Z Copying file: '.eslintrc.js'
2019-09-11T18:19:45.4590931Z Copying file: '.gitignore'
2019-09-11T18:19:45.4591005Z Copying file: '.prettierrc'
2019-09-11T18:19:45.4591058Z Copying file: 'README.md'
2019-09-11T18:19:45.4591218Z Copying file: 'jest.config.js'
2019-09-11T18:19:45.4591276Z Copying file: 'jsconfig.json'
2019-09-11T18:19:45.4591376Z Copying file: 'nuxt.config.ts'
2019-09-11T18:19:45.4591432Z Copying file: 'package-lock.json'
2019-09-11T18:19:45.4591869Z Copying file: 'package.json'
2019-09-11T18:19:45.4591932Z Copying file: 'tailwind.config.js'
2019-09-11T18:19:45.4592038Z Copying file: 'tsconfig.json'
2019-09-11T18:19:45.4592100Z Copying file: 'web.config'
2019-09-11T18:19:45.4592156Z Ignoring: .git
2019-09-11T18:19:45.4592461Z Copying file: '.nuxt/App.js'
2019-09-11T18:19:45.4592523Z Copying file: '.nuxt/axios.js'
2019-09-11T18:19:45.4592636Z Copying file: '.nuxt/client.js'
2019-09-11T18:19:45.4592700Z Copying file: '.nuxt/empty.js'
2019-09-11T18:19:45.4592814Z Copying file: '.nuxt/google-analytics.js'
2019-09-11T18:19:45.4592884Z Copying file: '.nuxt/index.js'
2019-09-11T18:19:45.4592995Z Copying file: '.nuxt/loading.html'
2019-09-11T18:19:45.4593062Z Copying file: '.nuxt/middleware.js'
2019-09-11T18:19:45.4593425Z Copying file: '.nuxt/router.js'
2019-09-11T18:19:45.4593556Z Copying file: '.nuxt/router.scrollBehavior.js'
2019-09-11T18:19:45.4593626Z Copying file: '.nuxt/server.js'
2019-09-11T18:19:45.4593755Z Copying file: '.nuxt/templates.plugin.0b0c469e.js'
2019-09-11T18:19:45.4593824Z Copying file: '.nuxt/utils.js'
2019-09-11T18:19:45.4596562Z Copying file: '.nuxt/vue-scrollto.js'
2019-09-11T18:19:45.4596648Z Copying file: '.nuxt/components/nuxt-build-indicator.vue'
2019-09-11T18:19:45.4596774Z Copying file: '.nuxt/components/nuxt-child.js'
2019-09-11T18:19:45.4596844Z Copying file: '.nuxt/components/nuxt-error.vue'
2019-09-11T18:19:45.4596966Z Copying file: '.nuxt/components/nuxt-link.client.js'
2019-09-11T18:19:45.4597040Z Copying file: '.nuxt/components/nuxt-link.server.js'
2019-09-11T18:19:45.4597306Z Copying file: '.nuxt/components/nuxt-loading.vue'
2019-09-11T18:19:45.4598373Z Copying file: '.nuxt/components/nuxt.js'
2019-09-11T18:19:45.4598645Z Copying file: '.nuxt/dist/client/19990754445b7faf5eb2.css'
2019-09-11T18:19:45.4599032Z Copying file: '.nuxt/dist/client/227962d7eb678c20a051.css'
2019-09-11T18:19:45.4599188Z Copying file: '.nuxt/dist/client/2fdd9b61ddd36b762ff9.js'
2019-09-11T18:19:45.4601404Z Copying file: '.nuxt/dist/client/3945d0c3702d4e12caa3.css'
2019-09-11T18:19:45.4601700Z Copying file: '.nuxt/dist/client/4759091df355223d981b.js'
2019-09-11T18:19:45.4602309Z Copying file: '.nuxt/dist/client/49f432b27785c659e811.js'
2019-09-11T18:19:45.4602529Z Copying file: '.nuxt/dist/client/67de79466fb650132f63.js'
2019-09-11T18:19:45.4602700Z Copying file: '.nuxt/dist/client/6c10445563bd529fc718.js'
2019-09-11T18:19:45.4602914Z Copying file: '.nuxt/dist/client/7790a9102e5d2e10267f.css'
2019-09-11T18:19:45.4603084Z Copying file: '.nuxt/dist/client/8893ad564ba1f8e11859.js'
2019-09-11T18:19:45.4603303Z Copying file: '.nuxt/dist/client/8b8fdf780113008e74f2.js'
2019-09-11T18:19:45.4603472Z Copying file: '.nuxt/dist/client/LICENSES'
2019-09-11T18:19:45.4603708Z Copying file: '.nuxt/dist/client/a3427b2af617f7dc4ebc.css'
2019-09-11T18:19:45.4603873Z Omitting next output lines...
2019-09-11T18:19:45.4604083Z Processed 563 files...
2019-09-11T18:19:45.4604240Z Processed 1258 files...
2019-09-11T18:19:45.4604458Z Processed 1990 files...
2019-09-11T18:19:45.4604613Z Processed 2648 files...
2019-09-11T18:19:45.4604815Z Processed 3268 files...
2019-09-11T18:19:45.4604971Z Processed 3920 files...
2019-09-11T18:19:45.4605119Z Processed 4470 files...
2019-09-11T18:19:45.4605689Z Processed 5091 files...
2019-09-11T18:19:45.4605913Z Processed 5743 files...
2019-09-11T18:19:45.4606325Z Processed 6043 files...
2019-09-11T18:19:45.4606481Z Processed 6373 files...
2019-09-11T18:19:45.4606694Z Processed 7084 files...
2019-09-11T18:19:45.4606848Z Processed 7776 files...
2019-09-11T18:19:45.4607061Z Processed 8230 files...
2019-09-11T18:19:45.4607215Z Processed 8970 files...
2019-09-11T18:19:45.4607465Z Processed 9687 files...
2019-09-11T18:19:45.4607634Z Running oryx build...
2019-09-11T18:19:45.7612904Z Command: oryx build /home/site/wwwroot -o /home/site/wwwroot --platform nodejs --platform-version 10.14 -i /tmp/8d736e37fd94d05 -p compress_node_modules=tar-gz
2019-09-11T18:19:45.7613646Z Build orchestrated by Microsoft Oryx, https://github.com/Microsoft/Oryx
2019-09-11T18:19:45.7614063Z You can report issues at https://github.com/Microsoft/Oryx/issues
2019-09-11T18:19:45.7614543Z 
2019-09-11T18:19:45.7615709Z Oryx Version      : 0.2.20190730.1, Commit: 4ef0d5854df39c57605e59bb6d255215cc85468a
2019-09-11T18:19:45.7616145Z Build Operation ID: |BhNs02jorew=.da57f928_
2019-09-11T18:19:45.7616563Z Repository Commit : fc0cb5fdce89454385873bdebd7b7b46
2019-09-11T18:19:45.7616996Z 
2019-09-11T18:19:45.7617377Z Warning: An outdated version of node was detected (10.14.2). Consider updating.\nVersions supported by Oryx: https://github.com/microsoft/Oryx
2019-09-11T18:19:45.7617816Z 
2019-09-11T18:19:45.7618179Z Using intermediate directory '/tmp/8d736e37fd94d05'.
2019-09-11T18:19:45.7619042Z 
2019-09-11T18:19:45.7619437Z Copying files to the intermediate directory...
2019-09-11T18:19:45.7619753Z Done in 4 sec(s).
2019-09-11T18:19:45.7620096Z 
2019-09-11T18:19:45.7620424Z Source directory     : /tmp/8d736e37fd94d05
2019-09-11T18:19:45.7620797Z Destination directory: /home/site/wwwroot
2019-09-11T18:19:45.7621095Z 
2019-09-11T18:19:45.7621376Z 
2019-09-11T18:19:45.7622101Z Running 'npm install'...
2019-09-11T18:19:45.7622410Z 
2019-09-11T18:19:45.7622708Z 
2019-09-11T18:19:45.7623103Z > core-js@2.6.9 postinstall /tmp/8d736e37fd94d05/node_modules/core-js
2019-09-11T18:19:45.7623452Z > node scripts/postinstall || echo "ignore"
2019-09-11T18:19:45.7623908Z 
2019-09-11T18:19:45.7624273Z ‌Thank you for using core-js (‌ https://github.com/zloirock/core-js ‌) for polyfilling JavaScript standard library!‌
2019-09-11T18:19:45.7624598Z 
2019-09-11T18:19:45.7626930Z ‌The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: ‌
2019-09-11T18:19:45.7627362Z ‌>‌ https://opencollective.com/core-js ‌
2019-09-11T18:19:45.7627810Z ‌>‌ https://www.patreon.com/zloirock ‌
2019-09-11T18:19:45.7629055Z 
2019-09-11T18:19:45.7629639Z ‌Also, the author of core-js (‌ https://github.com/zloirock ‌) is looking for a good job -)‌
2019-09-11T18:19:45.7629941Z 
2019-09-11T18:19:45.7630221Z 
2019-09-11T18:19:45.7630603Z > nuxt@2.9.2 postinstall /tmp/8d736e37fd94d05/node_modules/nuxt
2019-09-11T18:19:45.7630925Z > opencollective || exit 0
2019-09-11T18:19:45.7631272Z 
2019-09-11T18:19:45.7631553Z 
2019-09-11T18:19:45.7632058Z > browsy.landingpage@0.0.0 postinstall /tmp/8d736e37fd94d05
2019-09-11T18:19:45.7632464Z > npm run build
2019-09-11T18:19:45.7632765Z 
2019-09-11T18:19:45.7633124Z 
2019-09-11T18:19:45.7633453Z > browsy.landingpage@0.0.0 build /tmp/8d736e37fd94d05
2019-09-11T18:19:45.7633875Z > npm run build:prod
2019-09-11T18:19:45.7634191Z 
2019-09-11T18:19:45.7634506Z 
2019-09-11T18:19:45.7635056Z > browsy.landingpage@0.0.0 build:prod /tmp/8d736e37fd94d05
2019-09-11T18:19:45.7636048Z > nuxt-ts build
2019-09-11T18:19:45.7636373Z 
2019-09-11T18:19:45.7636764Z 
2019-09-11T18:19:45.7637129Z  ERROR  Cannot find module 'typescript'
2019-09-11T18:19:45.7637559Z 
2019-09-11T18:19:45.7637924Z   at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
2019-09-11T18:19:45.7638355Z   at Function.resolve (internal/modules/cjs/helpers.js:32:19)
2019-09-11T18:19:45.7638719Z   at register (node_modules/ts-node/dist/index.js:137:30)
2019-09-11T18:19:45.7639404Z   at registerTSNode (node_modules/@nuxt/typescript-runtime/lib/register.js:5:3)
2019-09-11T18:19:45.7639754Z   at main (node_modules/@nuxt/typescript-runtime/bin/nuxt-ts.js:10:3)
2019-09-11T18:19:45.7640143Z   at Object.<anonymous> (node_modules/@nuxt/typescript-runtime/bin/nuxt-ts.js:16:3)
2019-09-11T18:19:45.7640483Z   at Module._compile (internal/modules/cjs/loader.js:689:30)
2019-09-11T18:19:45.7658589Z   at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
2019-09-11T18:19:45.7659723Z   at Module.load (internal/modules/cjs/loader.js:599:32)
2019-09-11T18:19:45.7660505Z   at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
2019-09-11T18:19:45.7660852Z 
2019-09-11T18:19:45.7661179Z npm ERR! code ELIFECYCLE
2019-09-11T18:19:45.7661877Z npm ERR! errno 1
2019-09-11T18:19:45.7662828Z npm ERR! browsy.landingpage@0.0.0 build:prod: `nuxt-ts build`
2019-09-11T18:19:45.7663195Z npm ERR! Exit status 1
2019-09-11T18:19:45.7663602Z npm ERR! 
2019-09-11T18:19:45.7663956Z npm ERR! Failed at the browsy.landingpage@0.0.0 build:prod script.
2019-09-11T18:19:45.7664396Z npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-09-11T18:19:45.7664729Z 
2019-09-11T18:19:45.7666116Z npm ERR! A complete log of this run can be found in:
2019-09-11T18:19:45.7666551Z npm ERR!     /home/.npm/_logs/2019-09-11T18_19_22_640Z-debug.log
2019-09-11T18:19:45.7667820Z npm ERR! code ELIFECYCLE
2019-09-11T18:19:45.7668286Z npm ERR! errno 1
2019-09-11T18:19:45.7668704Z npm ERR! browsy.landingpage@0.0.0 build: `npm run build:prod`
2019-09-11T18:19:45.7669063Z npm ERR! Exit status 1
2019-09-11T18:19:45.7669624Z npm ERR! 
2019-09-11T18:19:45.7669971Z npm ERR! Failed at the browsy.landingpage@0.0.0 build script.
2019-09-11T18:19:45.7670381Z npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-09-11T18:19:45.7670707Z 
2019-09-11T18:19:45.7671043Z npm ERR! A complete log of this run can be found in:
2019-09-11T18:19:45.7671660Z npm ERR!     /home/.npm/_logs/2019-09-11T18_19_22_862Z-debug.log
2019-09-11T18:19:45.7672014Z npm ERR! code ELIFECYCLE
2019-09-11T18:19:45.7672421Z npm ERR! errno 1
2019-09-11T18:19:45.7672775Z npm ERR! browsy.landingpage@0.0.0 postinstall: `npm run build`
2019-09-11T18:19:45.7673336Z npm ERR! Exit status 1
2019-09-11T18:19:45.7673666Z npm ERR! 
2019-09-11T18:19:45.7674082Z npm ERR! Failed at the browsy.landingpage@0.0.0 postinstall script.
2019-09-11T18:19:45.7674445Z npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-09-11T18:19:45.7675023Z 
2019-09-11T18:19:45.7675367Z npm ERR! A complete log of this run can be found in:
2019-09-11T18:19:45.7676212Z npm ERR!     /home/.npm/_logs/2019-09-11T18_19_23_157Z-debug.log
2019-09-11T18:19:45.7677671Z ERROR  Cannot find module 'typescript'\n\n  at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)\n  at Function.resolve (internal/modules/cjs/helpers.js:32:19)\n  at register (node_modules/ts-node/dist/index.js:137:30)\n  at registerTSNode (node_modules/@nuxt/typescript-runtime/lib/register.js:5:3)\n  at main (node_modules/@nuxt/typescript-runtime/bin/nuxt-ts.js:10:3)\n  at Object.<anonymous> (node_modules/@nuxt/typescript-runtime/bin/nuxt-ts.js:16:3)\n  at Module._compile (internal/modules/cjs/loader.js:689:30)\n  at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)\n  at Module.load (internal/modules/cjs/loader.js:599:32)\n  at tryModuleLoad (internal/modules/cjs/loader.js:538:12)\n\nnpm ERR! code ELIFECYCLE\nnpm ERR! errno 1\nnpm ERR! browsy.landingpage@0.0.0 build:prod: `nuxt-ts build`\nnpm ERR! Exit status 1\nnpm ERR! \nnpm ERR! Failed at the browsy.landingpage@0.0.0 build:prod script.\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!     /home/.npm/_logs/2019-09-11T18_19_22_640Z-debug.log\nnpm ERR! code ELIFECYCLE\nnpm ERR! errno 1\nnpm ERR! browsy.landingpage@0.0.0 build: `npm run build:prod`\nnpm ERR! Exit status 1\nnpm ERR! \nnpm ERR! Failed at the browsy.landingpage@0.0.0 build script.\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!     /home/.npm/_logs/2019-09-11T18_19_22_862Z-debug.log\nnpm ERR! code ELIFECYCLE\nnpm ERR! errno 1\nnpm ERR! browsy.landingpage@0.0.0 postinstall: `npm run build`\nnpm ERR! Exit status 1\nnpm ERR! \nnpm ERR! Failed at the browsy.landingpage@0.0.0 postinstall script.\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!     /home/.npm/_logs/2019-09-11T18_19_23_157Z-debug.log\n/opt/Kudu/Scripts/starter.sh oryx build /home/site/wwwroot -o /home/site/wwwroot --platform nodejs --platform-version 10.14 -i /tmp/8d736e37fd94d05 -p compress_node_modules=tar-gz
2019-09-11T18:19:45.7678822Z App container will begin restart within 10 seconds.
2019-09-11T18:19:45.7755467Z ##[error]Failed to deploy web package to App Service.
2019-09-11T18:19:45.7767775Z ##[error]Error: Package deployment using ZIP Deploy failed. Refer logs for more details.
2019-09-11T18:19:46.9304647Z Successfully updated deployment History at https://browsy-landingpage.scm.azurewebsites.net/api/deployments/571568225986018
2019-09-11T18:19:47.1628798Z App Service Application URL: http://browsy-landingpage.azurewebsites.net
2019-09-11T18:19:47.1868969Z ##[section]Finishing: Deploy Azure App Service
@arroyc
Copy link
Contributor

arroyc commented Sep 12, 2019

Thanks for reporting the issue. I will try to repro this based on the images and the log you have provided and will get back to you as soon as I find something.

@arroyc
Copy link
Contributor

arroyc commented Sep 12, 2019

@janekkkk, quick update .. I just tried a sample nodejs app using azure devops and app service task as you mentioned …
image
Only thing I added extra is application and configuration settings where I added compress_node_modules=zip in app settings, you can add it manually in your app service also in azure portal. I think it's better to do it in portal, I got an warning while doing it via azure devops task.

It seem to be working for me.
image

Here is my log for successful upload of zip in app service

##[section]Starting: Azure App Service Deploy 1
==============================================================================
Task : Azure App Service deploy
Description : Deploy to Azure App Service a web, mobile, or API app using Docker, Java, .NET, .NET Core, Node.js, PHP, Python, or Ruby
Version : 4.157.0
Author : Microsoft Corporation
Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/deploy/azure-rm-web-app-deployment
==============================================================================
Got service connection details for Azure App Service:'arroyc123'
Package deployment using ZIP Deploy initiated.
Deploy logs can be viewed at https://arroyc123.scm.azurewebsites.net/api/deployments/2bb4a1add99a483abdb0e5bdf481adf4/log
Successfully deployed web package to App Service.

@arroyc
Copy link
Contributor

arroyc commented Sep 12, 2019

I will try other combinations also to repro your exact issue.

@janekkkk
Copy link
Author

For now I've removed my npm build script from package.json which fixes this problem but I shouldn't have to ofcourse. Thanks for your help so far!

@arroyc
Copy link
Contributor

arroyc commented Sep 12, 2019

@janekkkk would you be able to share the app .. it can help me repro the steps, or else let me know if https://github.com/Hiswe/nuxt-universal-application will be a good comparison to your app with which I can try repro.

Also please share the build script in your package.json

@janekkkk
Copy link
Author

janekkkk commented Sep 19, 2019

@arroyc, I can't share it. Also the example app isn't a good example because I'm using the new nuxt-ts API.
https://typescript.nuxtjs.org/guide/

@arroyc
Copy link
Contributor

arroyc commented Sep 19, 2019

@janekkk, what were the steps in npm build scripts?

@janekkkk
Copy link
Author

   "start:prod": "node_modules/@nuxt/cli/bin/nuxt-cli.js start --hostname 0.0.0.0 --port 8080",
    "build:prod": "nuxt-ts build",

@arroyc
Copy link
Contributor

arroyc commented Sep 25, 2019

Thanks @janekkkk, investigating this .. will update you at my earliest

@kichalla
Copy link
Contributor

@janekkkk This issue should be fixed now. Can you please check again?

@janekkkk
Copy link
Author

I'll change my deployment settings when I've got the time. Probably next week.

@arroyc
Copy link
Contributor

arroyc commented Nov 11, 2019

@janekkkk did you get a chance to change your deployment settings and retry? Are you still facing the issue?

@arroyc
Copy link
Contributor

arroyc commented Apr 3, 2020

feel free to reopen in case you have any issues

@arroyc arroyc closed this as completed Apr 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants