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

"npm init react-app my-app" indicates wrong (unsupported) version of node only when using the snap of version 16.15.1 #40

Open
earthwormjim2 opened this issue Jun 7, 2022 · 3 comments

Comments

@earthwormjim2
Copy link

The result is that it creates an application with an old (unsupported) toolchain (which has a lot of security vulnerabilities). If I instead use the same version of node, packaged at nodesource: https://github.com/nodesource/distributions/blob/master/README.md it works fine.

My platform is Ubuntu 22.04.

Application Message follows:

"Note: the project was bootstrapped with an old unsupported version of tools. Please update to Node >=6 and npm >=3 to get supported tools in new projects."

@rvagg
Copy link
Member

rvagg commented Jun 8, 2022

I think this is probably a dupe of #31, which I believe comes down to shelling out to node and not finding it properly in PATH because of the way Snaps do PATH manipulation.
It's frustrating and the source of many problems, but I'm not really sure what to do about it. It'd be great to have someone dig deeper and figure out the actual root cause and see if there's any workaround we can implement to make child process calls more robust when called from within a Snap node.

@KristijanZic
Copy link

I get the same issue when executing create-react-app <my-app> --template typescript
I get:

Note: the project was bootstrapped with an old unsupported version of tools.
Please update to Node >=14 and npm >=6 to get supported tools in new projects.

even tho:

$ node --version && npm --version
v16.17.0
8.17.0

@rvagg
Copy link
Member

rvagg commented Aug 22, 2022

Do you have an older version of node on your system that's being masked by the newer one in the snap? maybe try removing that and the error might go away. Unfortunately so might your ability to run the command at all because it seems like it might be using that old version of Node to do the actual work.

Another thing you could try is manually "fixing" the PATH to provide a more direct route to the Snap node exe, something like: PATH=/snap/node/current/usr/bin/:$PATH create-react-app ... (I think /snap/node/current/usr/bin/ is right, I don't have a snap install handy to check, see if there's a node in that path, it'll be somewhere under /snap/node/current/ in a bin dir).

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