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

oao docker issue when bootstrap with TypeError: cmd.opts is not a function #15

Closed
jogelin opened this issue Feb 22, 2017 · 7 comments
Closed

Comments

@jogelin
Copy link
Contributor

jogelin commented Feb 22, 2017

Hello,

I would like to use oao during my build inside a docker image but I have an issue during the bootstrap :

16:36:59.680 $ oao bootstrap -s ./packages/*/ 
16:36:59.985 2017-02-22T15:36:59.974Z           storyboard INFO  ??? ROOT STORY: Node.js 7.5.0 on Linux 64-bit, SB 3.0.0 [CREATED]
16:36:59.986 2017-02-22T15:36:59.975Z           storyboard INFO  Log filter: *:DEBUG
16:37:00.174 2017-02-22T15:37:00.173Z           storyboard INFO  ??? ROOT STORY: Node.js 7.5.0 on Linux 64-bit, SB 3.0.0 [CLOSED]
16:37:00.174 /home/app/node_modules/oao/lib/index.js:60
16:37:00.174   return (0, _bootstrap2.default)(cmd.opts());
16:37:00.174                                       ^
16:37:00.174 
16:37:00.174 TypeError: cmd.opts is not a function
16:37:00.174     at Command.<anonymous> (/home/app/node_modules/oao/lib/index.js:60:39)
16:37:00.174     at Command.listener (/home/app/node_modules/commander/index.js:301:8)
16:37:00.174     at emitTwo (events.js:106:13)
16:37:00.175     at Command.emit (events.js:192:7)
16:37:00.175     at Command.parseArgs (/home/app/node_modules/commander/index.js:615:12)
16:37:00.175     at Command.parse (/home/app/node_modules/commander/index.js:458:21)
16:37:00.175     at Object.<anonymous> (/home/app/node_modules/oao/lib/index.js:98:21)
16:37:00.175     at Module._compile (module.js:571:32)
16:37:00.175     at Object.Module._extensions..js (module.js:580:10)
16:37:00.175     at Module.load (module.js:488:32)
16:37:00.181 error Command failed with exit code 1.
16:37:00.181 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
16:37:00.186 ERROR: "bootstrap" exited with 1.
16:37:00.192 error Command failed with exit code 1.

My docker-compose.yml :

version: '2'
services:
  js-build:
    container_name: js-build
    image: node:7.5.0
    command: npm install yarn -g --progress=false && npm install && yarn build"
    working_dir: /home/app
    volumes:
      - .:/home/app

You can run it using the command :

docker-compose run js-build
@jogelin jogelin changed the title oao boo oao docker issue when bootstrap with TypeError: cmd.opts is not a function Feb 22, 2017
@guigrpa
Copy link
Owner

guigrpa commented Feb 22, 2017

Are you running oao as a global package or inside your application?

If inside your application: could you please copy the result of npm list commander?

@guigrpa
Copy link
Owner

guigrpa commented Feb 22, 2017

(I bet some other dependency is using an older version of commander…)

@jogelin
Copy link
Contributor Author

jogelin commented Feb 22, 2017

I am running oao inside my app ! Only yarn is installed as a global package.

npm list commander :

@viper/parent@0.0.1 /home/app
`-- oao@0.5.5
  `-- commander@2.9.0

I don't know if it can help but below you can find a part my scripts that I used to run oao :

"all": "oao all -s ./packages/*/",
"bootstrap": "oao bootstrap -s ./packages/*/",
"transpile": "ngc -p ./packages/tsconfig.json",
"package": "npm run all -- \"rollup -c rollup.config.js\"",
"build": "npm-run-all bootstrap transpile package",

@guigrpa
Copy link
Owner

guigrpa commented Feb 23, 2017

Several notes:

  • Please check whether it works with -s packages/*, or without the -s flag altogether, since packages/* is already the default value
  • Could you please provide the simplest possible reproduction (with as few dependencies as possible) in the form of a working gist, a repo, or some instructions? Thanks!

Also (nothing to do with the issue): I guess your oao all call is missing the command argument.

@jogelin
Copy link
Contributor Author

jogelin commented Feb 23, 2017

  • I put the argument "-s packages/*/" with a "/" at the end (and not "-s /packages/*") before you improved the filter to avoid getting non folder in your listPath. I will remove it now thx !
  • I will try to give you a simple example but it's only with docker !
  • the oao all is only there to be used with other command like oao all -- <command>

Again, thanks for your reactivity !

@jogelin
Copy link
Contributor Author

jogelin commented Feb 23, 2017

After some investigations during the implementation of the simple example, it was indeed caused by the -s /packages/* argument.

You can find the simple example there jogelin/oao-docker with a simple description in the README.md

@guigrpa
Copy link
Owner

guigrpa commented Feb 23, 2017

I guess your problem was caused by a shell exploding the wildcard * before the argument reached oao... I'm closing this for now, but reopen if the problem comes back.

@guigrpa guigrpa closed this as completed Feb 23, 2017
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

2 participants