decentraland / editor-sdk7

VSCode extension for Decentraland SDK7 projects
https://marketplace.visualstudio.com/items?itemName=DecentralandFoundation.decentraland-sdk7
MIT License
3 stars 5 forks source link

Having a `node` setup introduces issues #119

Open leanmendoza opened 1 week ago

leanmendoza commented 1 week ago

Intro

Many people have struggled with this issue. Some worked around it with a manual npm install in the extension folder, while others couldn't. https://github.com/decentraland/editor-sdk7/issues/111 might relate to this. Some of their representations are: sdk-commands not found, not being able to copy cache, npm install failed I've seen there is already a node environment in most of the cases (i can't say 100% because I'm not sure)

A repro case for Windows

  1. Remove all the node environments in your machine (uninstall nvm-windows - if you have - , node)
  2. Install nvm-windows: https://github.com/coreybutler/nvm-windows/releases
  3. Install node with nvm install lts and nvm use 20.15.0 (at the time this issue is written)
  4. Clean Decentraland vscode extension
  5. Open only one window of VSCode and without opening a folder and install the Decentraland SDK7 Extension version 1.53.1 (latest at the time this is written)
  6. Click on the extension icon in the VSCode's left-bar to activate the extension and open the output > Decentraland SDK7
  7. See how now it's failing in the copy cache step image

In this case, the issue is working around it with an early return in the cacheDependencies method (with hacky modifying the dist/editor.js file) here https://github.com/decentraland/editor-sdk7/blob/52ffce674a3d01f9bc5ea0870df313ec250bfff1/src/modules/npm.ts#L113

stom66 commented 1 week ago

Can confirm I've had the issue on both windows 10 and 11, with extension version 1.51.* and above, with node installed or not.

The suggested workaround fixes the issue for me.