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

Initialization failed while loading node modules #450

Closed
DavidDTA opened this issue Jan 31, 2024 · 4 comments
Closed

Initialization failed while loading node modules #450

DavidDTA opened this issue Jan 31, 2024 · 4 comments

Comments

@DavidDTA
Copy link
Contributor

Following the instructions in the Getting Started section of the docs, I ran npx elm-pages init my-project, and it failed with the following error:

$ npx elm-pages init my-project
file:///home/dta/.npm/_npx/f522c3e74dfcf71b/node_modules/globby/index.js:27
	const extensionGlob = extensions?.length > 0 ? `.${extensions.length > 1 ? `{${extensions.join(',')}}` : extensions[0]}` : '';
	                                 ^

SyntaxError: Unexpected token '.'
    at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)

I am not an expert in node/npm, but it looks like it's not correctly interpreting the syntax of one of the packages used in the package loader.

Here are some diagnostics. Let me know if anything else would be relevant.

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.3 LTS
Release:	22.04
Codename:	jammy
$ node --version
v12.22.9
$ npx --version
8.5.1
@DavidDTA
Copy link
Contributor Author

It looks like the most recent version of node available via the ubuntu package manager on 22.0.4 may be quite old, and I expect that may be it. I'll try re-installing node with nvm to see if I can get a more recent version.

It might be worth specifying the npm/node version requirements in the getting started guide.

@dillonkearns
Copy link
Owner

Yeah, even Node 16 is already end of life. Basically the intention is to support whatever the Node EOL schedule is: https://nodejs.org/en/about/previous-releases.

I would welcome a PR to add something about that to the docs somewhere.

@DavidDTA
Copy link
Contributor Author

I had made the apparently erroneous assumption that the LTS version of Ubuntu would provide the LTS version of node. Using node 20.11.0 via nvm seems to have worked.

@dillonkearns
Copy link
Owner

Yeah, that is surprising that it's such an outdated one.

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