Skip to content
This repository has been archived by the owner on May 27, 2021. It is now read-only.

npx install failing - cannot spawn child process #57

Closed
1 of 5 tasks
thescientist13 opened this issue Nov 19, 2018 · 3 comments · Fixed by #58
Closed
1 of 5 tasks

npx install failing - cannot spawn child process #57

thescientist13 opened this issue Nov 19, 2018 · 3 comments · Fixed by #58
Assignees
Labels
0.4.1 bug Something isn't working

Comments

@thescientist13
Copy link
Member

thescientist13 commented Nov 19, 2018

Type of Change

  • New Feature Request
  • Documentation
  • Improvement / Suggestion
  • Bug
  • Other (please clarify below)

Summary

Related to #54 , it looks like I had a local installation of create-evergreen-app, that was messing with things. I can now reproduce this across OSX, Linux, and Windows.

$ npx create-evergreen-app
npx: installed 3 in 1.49s
Cannot find module 'cross-spawn'
$ npx create-evergreen-app my-app
npx: installed 3 in 1.427s
Cannot find module 'cross-spawn'
$ npx -D -p  create-evergreen-app my-app
npx: installed 203 in 5.868s
npx: command not found: create-evergreen-app
$ npx -D -p create-evergreen-app create-evergreen-app  my-app
npx: installed 203 in 4.763s
npx: command not found: create-evergreen-app
$ npx create-evergreen-app create-evergren-app my-app
npx: installed 3 in 1.47s
Cannot find module 'cross-spawn'

Details

Maybe we need npm install and npx? I was hoping npx would replace the need for a global install.

@thescientist13 thescientist13 added the bug Something isn't working label Nov 19, 2018
@thescientist13
Copy link
Member Author

I think the real solution is not use anything in cea-install.js that is not part of the standard NodeJS API.

Will look into testing child-process again.

@thescientist13 thescientist13 self-assigned this Nov 19, 2018
@hutchgrant
Copy link
Member

hutchgrant commented Nov 19, 2018

CRA uses cross-spawn and it works fine from npx. I think it has to do with being a devdependency in CEA and CRA uses it as a regular dependency

So the solution is to create separate dependencies for the package.json for the CEA vs the application it generates. This would obviously cause the unit tests to fail and would have to be rewritten to spawn a new application and test based on that. Which may actually be beneficial anyways.

Or you can create and include it as a separate dev-utils package, which uses cross-spawn as just a regular dependency, which CRA also does with react-scripts.

Also cross-spawn is a cross-platform replacement for child_process spawn which has issues on windows. It's probably a better idea to continue using it, unless you have any other suggestions.

Or we could just not recommend npx at all.

@thescientist13
Copy link
Member Author

thescientist13 commented Nov 19, 2018

tested by ignoring that file, and now got this

$ rm -rf my-app/ && npx github:ProjectEvergreen/create-evergreen-app#775a131b091607f7628990282d4dbcd9c8238930 my-app
npx: installed 3 in 5.215s
-------------------------------------------------------
Welcome to Create Evergreen App ♻️
-------------------------------------------------------
Preparing project directory...
Initializing npm dependencies...
Copying project files...
File doesn't exist! : /Users/owenbuckley/.npm/_npx/72803/lib/node_modules/create-evergreen-app/package-lock.json

😖

Not sure if npx will be helpful testing outside of from npm? I guess since npx create-evergreen-app is already broken, no harm in pushing a new version even if it doesn't work? Seems like it will just be a little trial and error, but I think it's close. ❓

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
0.4.1 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants