appsody / appsody

Appsody command line tool. This repo will be archived soon.
https://appsody.dev
171 stars 46 forks source link

Appsody run fails in Windows #777

Open aniforverizon opened 4 years ago

aniforverizon commented 4 years ago

I was trying to run the code from this repository: https://github.com/IBM/appsody-sample-quote-app

I found this error:

PS C:\Users\lenovo\quote-frontend> appsody run Running development environment... Pulling docker image docker.io/appsody/nodejs-express:0.2 Running command: docker pull docker.io/appsody/nodejs-express:0.2 0.2: Pulling from appsody/nodejs-express Digest: sha256:1ef7e63b1480494ffae54e95164e386385b84d580fa8fe84d9f024abd787697c Status: Image is up to date for appsody/nodejs-express:0.2 Running command: docker run --rm -p 3000:3000 -p 9229:9229 --name quote-frontend-dev -v C:/Users/lenovo/quote-frontend/:/project/user-app -v quote-frontend-deps:/project/user-app/node_modules -v appsody-controller-0.3.2:/.appsody -t --entrypoint /.appsody/appsody-controller docker.io/appsody/nodejs-express:0.2 --mode=run [Container] Running APPSODY_PREP command: npm install --prefix user-app && npm audit fix --prefix user-app npm ] / prepare:user-app: info l0;43mWARN The package request is included as both a dev and production dependency. [Container] added 1 package from 1 contributor, removed 1 package, updated 5 packages ange requesd audited 447 packages in 3.189s [Container] found 0 vulnerabilities [Container] npm WARN The package request is included as both a dev and production dependency. [Container] [Container] up to date in 1.719s [Container] fixed 0 of 0 vulnerabilities in 447 scanned packages [Container] [Container] [Container] ╭──────────────────────────────────────────────── ────────────────╮ [Container] │ │ [Container] │ New minor version of npm availab le! 6.9.0 -> 6.13.2 │ [Container] │ Changelog: https://github.com/npm/cli/releases/tag/v6.13.2 │ [Container] │ Run npm install -g npm to update! │ [Container] │ │ [Container] ╰────────────────────────────────────────────────────────────────╯ [Container] [Container] Running command: npm start [Container] [Container] > nodejs-express@0.2.10 start /project [Container] > node server.js [Container] [Container] [Sat Dec 7 10:21:51 2019] com.ibm.diagnostics.healthcenter.loader INFO: Node Application Metrics 5.1.1.201911221000 (Agent Core 4.0.5) [Container] Hello [Container] /project/node_modules/express/lib/router/index.js:458 [Container] throw new TypeError('Router.use() requires a middleware function but got a ' + gettype(fn)) [Container] ^ [Container] [Container] TypeError: Router.use() requires a middleware function but got a Object [Container] at Function.use (/project/node_modules/express/lib/router/index.js:458:13) [Container] at Function. (/project/node_modules/express/lib/application.js:220:21) [Container] at Array.forEach () [Container] at Function.use (/project/node_modules/express/lib/application.js:217:7) [Container] at Object. (/project/user-app/app.js:12:5) [Container] at Module._compile (internal/modules/cjs/loader.js:778:30) [Container] at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) [Container] at Module.load (internal/modules/cjs/loader.js:653:32) [Container] at tryModuleLoad (internal/modules/cjs/loader.js:593:12) [Container] at Function.Module._load (internal/modules/cjs/loader.js:585:3) [Container] npm ERR! code ELIFECYCLE [Container] npm ERR! errno 1 [Container] npm ERR! nodejs-express@0.2.10 start: node server.js [Container] npm ERR! Exit status 1 [Container] npm ERR! [Container] npm ERR! Failed at the nodejs-express@0.2.10 start script. [Container] npm ERR! This is probably not a problem with npm. There is likely additional logging output above. [Container] [Container] npm ERR! A complete log of this run can be found in: [Container] npm ERR! /root/.npm/_logs/2019-12-07T10_21_52_463Z-debug.log [Container] Wait received error on APPSODY_RUN/DEBUG/TEST exit status 1 Running command: docker stop quote-frontend-dev Closing down, development environment was interrupted.

tnixa commented 4 years ago

Is this a Windows Enterprise (IBM) OS? If so, did you follow the instructions here: https://appsody.dev/docs/docker-windows-aad/