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

node version prerequisite #1276

Closed
tuggle24 opened this issue Apr 29, 2021 · 2 comments
Closed

node version prerequisite #1276

tuggle24 opened this issue Apr 29, 2021 · 2 comments

Comments

@tuggle24
Copy link

Problem

I am unable to execute the following command which was listed in the getting started section of documentation site without receiving an error:

npm init svelte@next my-app

The error I received is:

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module

I believe this error is not a result from this library. I believe this error is a result from my version of node.js v12 not being able to load a file from this library. I think, and I may be wrong, the particular file for which node.js v12 is not able to load is:

packages/create-svelte/bin.js

My resolution

After searching the issues and the discord, I read a particular discord message which led me to a github comment which was helpful.
And therefore the only way I was able to resolve this issue was to increase my version of node.js to v14.

Question

My question is the following:
Is there a recommend method for executing the aforementioned command on node.js v12. Or in other words, is there a workaround besides upgrading my node version?

@babichjacob
Copy link
Member

babichjacob commented Apr 29, 2021

Yes, using Node 12.17 (maybe 18?) or higher is how you run the command on Node 12. The linked comment links to a comment about Node 12.20 (or so) or higher being needed for enhanced features, which may or may not be necessary.

But the most strongly recommended way is with Node 14 or 16.

@tuggle24
Copy link
Author

Thank you so much for your time and the very prompt reply.
Great community!
I look forward to continuing my exploration of svelte

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