apiel / isomor

19 stars 0 forks source link

Error spawning npx during setup #15

Closed HoldYourWaffle closed 4 years ago

HoldYourWaffle commented 4 years ago

I'm getting errors when using the setup commands. It looks like the npx command can't be found, which is weird since I used it to run the setup commands.

When running npx isomor:

? Enter the name of your project: tlo
? Select which library you want to use? Vue
events.js:288
      throw er; // Unhandled 'error' event
      ^

Error: spawn npx ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
    at onErrorNT (internal/child_process.js:469:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:273:12)
    at onErrorNT (internal/child_process.js:469:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawn npx',
  path: 'npx',
  spawnargs: [ 'isomor-vue-app', '*appname*' ]
}

When running npx isomor-vue-app:

• info Setup create-vue-app with isomor
• info Install VueJs in *folder*
• info Wait a little bit... we are loading Vue
events.js:288
      throw er; // Unhandled 'error' event
      ^

Error: spawn npx ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
    at onErrorNT (internal/child_process.js:469:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:273:12)
    at onErrorNT (internal/child_process.js:469:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawn npx',
  path: 'npx',
  spawnargs: [
    '@vue/cli',
    'create',
    '*appname*',
    '-i',
    '{"useConfigFiles":true,"plugins":{"@vue/cli-plugin-babel":{},"@vue/cli-plugin-typescript":{"classComponent":true,"useTsWithBabel":true}}}'
  ]
}

System details OS: Windows 10 Node: v12.16.1 npm/npx: v6.14.4 which npx returns C:\Program Files\nodejs\npx (which is in my PATH)

apiel commented 4 years ago

Thank for reporting the issue. I just try on my machine and also having some issue with isomor installer. I will try to fix this asap.

But using isomor-vue-app work for me on ubuntu: npx isomor-vue-app app-name By the way, even if it should not be related, do you have yarn installed? I never tested the installer on windows since I don't have, I will try to debug with some github workflow https://github.com/apiel/isomor/actions


Edit I was able to reproduce your error: https://github.com/apiel/isomor/runs/562586118?check_suite_focus=true

apiel commented 4 years ago

Seem to be fixed in https://github.com/apiel/isomor/runs/562603508?check_suite_focus=true

Right now, only npx isomor-vue-app tlo is working, I will keep fixinf the rest.

HoldYourWaffle commented 4 years ago

By the way, even if it should not be related, do you have yarn installed?

Apparently I do, v1.22.4, although I never use it.

Right now, only npx isomor-vue-app tlo is working, I will keep fixinf the rest.

Great, thank you! I'll be sure to check it out tomorrow.

apiel commented 4 years ago

Ok now everything should be fine, fixed in https://github.com/apiel/isomor/commit/bc274353b34d22439b758786ce9d0b6a4b8bc667

In case you still have problems, please re-open an issue. I will close this one.

Thanks again for reporting ;-)

HoldYourWaffle commented 4 years ago

Thank you so much for the quick fix!

The installer is able to do the npx-buisiness now, but right at the end I'm encountering another error:

It looks like the final cd command gets passed an path that's joinedlikethis instead of joined/like/this.

Also, little side note: perhaps it'd be good to change the color of the "running hooks" and "generating" messages at the top to something other than red, since red usually means something went wrong.

apiel commented 4 years ago

image

Right, I get the same in the CI test. I will fix this tomorrow. Thx ;-)

apiel commented 4 years ago

Ok, I fixed the last issue. From the CI, it seem that everything goes well. Please let me know it you still encounter problems.

Thank you