SAFE-Stack / SAFE-template

dotnet CLI template for SAFE project
MIT License
283 stars 87 forks source link

Template appears to be incompatible with latest version of node.js #538

Closed bmilhollin closed 1 year ago

bmilhollin commented 1 year ago

When installing the SAFE template on a new computer, I downloaded the LTS version of node.js and was not able to build the sample application. The error indicated it was a node.js issue. Several co-workers had run into this issue and recommended I remove v18 and install v16, and this took care of the issue.

jcmrva commented 1 year ago

Is this the error you're getting?

Starting target 'InstallClient' .> "C:\Program Files\nodejs\npm.CMD" install (In: false, Out: false, Err: false) npm ERR! Unexpected token '.'

33 verbose stack C:\ProgramData\nvm\v18.12.1\node_modules\npm\node_modules\libnpmfund:1 33 verbose stack ../workspaces/libnpmfund 33 verbose stack ^ 33 verbose stack 33 verbose stack SyntaxError: Unexpected token '.'

I tried v16.18.1 first but no change. v16.13.2 is the magic version.

olivercoad commented 1 year ago

@jcmrva I think you're actually running into an issue with nvm https://github.com/coreybutler/nvm-windows/issues/814

Hi @bmilhollin, thanks for opening an issue. When you make reports like this it would be useful if you could paste some actual logs so that we don't have to guess that the issue might be. If it's not the same issue as above, is it something like this?

Starting target 'InstallClient'
.> "/home/oliver/.nvm/versions/node/v18.12.1/bin/npm" install (In: false, Out: false, Err: false)
npm ERR! code EBADENGINE
npm ERR! engine Unsupported engine
npm ERR! engine Not compatible with your version of node/npm: undefined
npm ERR! notsup Not compatible with your version of node/npm: undefined
npm ERR! notsup Required: {"node":"~16","npm":"~8"}
npm ERR! notsup Actual:   {"npm":"8.19.2","node":"v18.12.1"}

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/oliver/.npm/_logs/2022-11-05T23_36_04_923Z-debug-0.log

If so, that's expected and is just npm enforcing that the versions of npm and node are the same as what's requested in package.json. That just helps increase consistency by making sure people use the same major versions. I believe the latest version of the safe template is actually compatible with node 18, so you can just change the version numbers or even just remove the engines part in the package.json and it should work fine.

teknikal-wizard commented 1 year ago

@bmilhollin could you let us know if the above comment addresses your issue? If so I will close off the ticket, thanks!

bmilhollin commented 1 year ago

Yes, thank you!

Get Outlook for iOShttps://aka.ms/o0ukef


From: Ryan Palmer @.> Sent: Friday, November 11, 2022 10:21:53 AM To: SAFE-Stack/SAFE-template @.> Cc: Milhollin, Beth @.>; Mention @.> Subject: Re: [SAFE-Stack/SAFE-template] Template appears to be incompatible with latest version of node.js (Issue #538)

[EXTERNAL]

@bmilhollinhttps://urldefense.com/v3/__https://github.com/bmilhollin__;!!NgSi4SaN6ydtRVQ-!x4x-5efW9MvWraCTVCoZKQ3XmRNoV-5EBfmCPMNdVKre-h-HXSenKea_OXqTn5d_dtUzJSmoXiDFq0UWs350l0Ua$ could you let us know if the above comment addresses your issue? If so I will close off the ticket, thanks!

— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https://github.com/SAFE-Stack/SAFE-template/issues/538*issuecomment-1311815767__;Iw!!NgSi4SaN6ydtRVQ-!x4x-5efW9MvWraCTVCoZKQ3XmRNoV-5EBfmCPMNdVKre-h-HXSenKea_OXqTn5d_dtUzJSmoXiDFq0UWsyYtrljc$, or unsubscribehttps://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AK7YNXMWGASZSKGKJMPXADLWHZQBDANCNFSM6AAAAAARX5UQ3U__;!!NgSi4SaN6ydtRVQ-!x4x-5efW9MvWraCTVCoZKQ3XmRNoV-5EBfmCPMNdVKre-h-HXSenKea_OXqTn5d_dtUzJSmoXiDFq0UWs9X2HMf5$. You are receiving this because you were mentioned.Message ID: @.***>