Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Task runner does not use correct node version with nvm #1442

Closed
austinoneil opened this issue Feb 4, 2022 · 15 comments · Fixed by #1461
Closed

Task runner does not use correct node version with nvm #1442

austinoneil opened this issue Feb 4, 2022 · 15 comments · Fixed by #1461
Labels
develop Issues related to developing the extension needs-more-info More details about this issue are needed for it to be actionable. stale

Comments

@austinoneil
Copy link

When building on OSX and running gulp build, it errors out on the webpack build stage. This seems to be resolved when downgrading node to version 11.15.0.

@github-actions github-actions bot added the triage New issues that have not been reviewed. label Feb 4, 2022
@benmcmorran
Copy link
Member

Thanks for the report. What version of Node were you using before the downgrade? Our CI builds with Node 14 on Mac without issues.

@benmcmorran benmcmorran added develop Issues related to developing the extension needs-more-info More details about this issue are needed for it to be actionable. and removed triage New issues that have not been reviewed. labels Feb 7, 2022
@austinoneil
Copy link
Author

Node is on v12.22.10.

npm is on 6.14.16.

I just tried it using Node v14.19.0 and npm v6.14.16 and I got the same error.

@benmcmorran
Copy link
Member

Hmm, okay. What's the error message? I made some changes to the webpack configuration yesterday, but I don't see why that would be sensitive to Node version.

@austinoneil
Copy link
Author

Sorry for the late response. Was very busy yesterday.

Here are the logs.

@benmcmorran
Copy link
Member

Thanks. Does it work if you run npm rebuild node-sass --force first? It looks like for some reason npm installed node-sass bindings for a different version of node. I'm also wondering if npm install ended up using a different version of Node than the Gulp tasks.

@austinoneil
Copy link
Author

It did not. Is there a specific version of node-sass I need to be using?

@BelKed
Copy link
Contributor

BelKed commented Feb 12, 2022

I had the almost same problem with node-sass:

Found bindings for the following environments:
  - OS X 64-bit with Node.js 12.x

But after deleting all node_modules folders and fetching recent changes from package-lock.json it worked without problems.

@davidcooper1
Copy link
Contributor

davidcooper1 commented Feb 15, 2022

@austinoneil Are you using nvm by any chance? I've noticed that, even if I set a node version using nvm use, the task runner will use the node version set as default in nvm. I've heard over node 17.x.x doesn't work for html-webpack.

@austinoneil
Copy link
Author

@davidcooper1 yes, I am using nvm.

@benmcmorran
Copy link
Member

Thanks all for the help! I'm renaming this issue to better reflect the discussion and will try to repro with nvm.

@benmcmorran benmcmorran removed the needs-more-info More details about this issue are needed for it to be actionable. label Feb 15, 2022
@benmcmorran benmcmorran changed the title does not build using recommended node version Task runner does not use correct node version with nvm Feb 15, 2022
@davidcooper1
Copy link
Contributor

davidcooper1 commented Feb 17, 2022

@austinoneil what versions of npm do you have installed? If you run nvm list what version has the default alias and which one are you using for the vscode-arduino directory? Can you try the following:

  1. Delete node_modules in base folder and src/views folder.
  2. Run nvm alias default <desired version>. (Desired version is 12+ according to README. However, node version 17+ errors on html-webpack due to an SSL issue.)
  3. Run nvm use <desired version> with repository base as CWD.
  4. Run npm i
  5. Run npm i -g gulp in case the used version's gulp installation was wiped out.
  6. Run the Launch Extension task or try to gulp build

@benmcmorran benmcmorran added the needs-more-info More details about this issue are needed for it to be actionable. label Feb 17, 2022
@github-actions github-actions bot removed the needs-more-info More details about this issue are needed for it to be actionable. label Feb 17, 2022
@benmcmorran
Copy link
Member

Reopening, #1461 likely does not fix this particular issue on Mac.

@benmcmorran benmcmorran reopened this Feb 17, 2022
@benmcmorran benmcmorran added the needs-more-info More details about this issue are needed for it to be actionable. label Feb 17, 2022
@github-actions github-actions bot added the triage New issues that have not been reviewed. label Feb 17, 2022
@davidcooper1
Copy link
Contributor

davidcooper1 commented Feb 24, 2022

The previous fix for linux #1461 does still fix the path issue to find gulp, but I've noticed a weird recurrence of gulp using a different node version. Not sure if I accidentally installed gulp globally using node 17 then ran with node 14 though. I fixed it locally for now, but I'll keep an eye out.

@benmcmorran benmcmorran removed the triage New issues that have not been reviewed. label Mar 23, 2022
@github-actions
Copy link

This issue has been automatically marked as stale because it has been inactive for 30 days. To reactivate the issue, simply post a comment with the requested information to help us diagnose this issue. If this issue remains inactive for another 7 days, it will be automatically closed.

@github-actions github-actions bot added the stale label Apr 22, 2022
@github-actions
Copy link

This issue has been automatically closed due to inactivity. If you are still experiencing problems, please open a new issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
develop Issues related to developing the extension needs-more-info More details about this issue are needed for it to be actionable. stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants