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

Creating projectError: spawn npm ENOENT #470

Closed
stiks opened this issue Jan 23, 2018 · 5 comments
Closed

Creating projectError: spawn npm ENOENT #470

stiks opened this issue Jan 23, 2018 · 5 comments

Comments

@stiks
Copy link

stiks commented Jan 23, 2018

Do you want to request a feature or report a bug?
Not sure if this is BUG or FEATURE

What is the current behaviour?
NPM is required to install preact using CLI, need an option to use yarn instead of npm or preact-cli should detect installed package manager

If the current behaviour is a bug, please provide the steps to reproduce.

$ preact create default frontend
ℹ INFO Assuming you meant preactjs-templates/default...
⠋ Creating projectError: spawn npm ENOENT

No issues if I'll install it by myself:

$ cd frontend && yarn install
... 
success Saved lockfile.
Done in 82.35s.

What is the expected behaviour?
CLI should detect installed package manager and use it.

If this is a feature request, what is motivation or use case for changing the behaviour?
NPM is dying, most of the people already using Yarn. I'm not asking to replace NPM with yarn, but would be good if CLI can detect installed package manager. It's hard to get Node and NPM in sync on Debian

Please mention other relevant information.

  • Node version v8.9.3
  • npm version not installed
  • Operating system Debian 9
  • CLI version v2.1.1
@lukeed
Copy link
Member

lukeed commented Jan 23, 2018

We actually have a --yarn flag you can use 😄

@reznord
Copy link
Member

reznord commented Jan 23, 2018

By default, when ever you create a new project using preact create default my-project, it configures with npm. If you want to create a project using yarn, you can pass on the --yarn flag i.e. preact create default my-project --yarn.

@stiks
Copy link
Author

stiks commented Jan 23, 2018

@lukeed @reznord Would be good if this will appear in preact help message as well as checking if npm is available as part of node check (and suggest use --yarn option)

@reznord
Copy link
Member

reznord commented Mar 28, 2018

@stiks preact help lists out all the commands which CLI has and preact create help list all the flags and gives detailed explanation for the same.

@reznord
Copy link
Member

reznord commented Mar 28, 2018

I am not able to reproduce this issue anymore. Please feel free to close this issue if you are still facing the issue.

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