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 link issue #9541

Open
gurumoorty-s opened this issue Mar 27, 2024 · 6 comments
Open

npm link issue #9541

gurumoorty-s opened this issue Mar 27, 2024 · 6 comments

Comments

@gurumoorty-s
Copy link

Expected Behavior

scratch-gui and scratch-vm should have linked correctly.

Actual Behavior

I have two approaches so let me tell both the errors:

Approach One:
On doing npm start I get a blank screen instead of the Scratch interface.

Approach Two:
On doing npm start I get the following error:

ERROR in ./src/components/gui/gui.jsx
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\components\gui'
@ ./src/components/gui/gui.jsx 14:0-28 373:27-29
@ ./src/containers/gui.jsx
@ ./src/playground/blocks-only.jsx

ERROR in ./src/components/menu-bar/menu-bar.jsx
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\components\menu-bar'
 @ ./src/components/menu-bar/menu-bar.jsx 23:0-28 703:27-29
 @ ./src/components/gui/gui.jsx
 @ ./src/containers/gui.jsx
 @ ./src/playground/blocks-only.jsx

ERROR in ./src/components/stage-header/stage-header.jsx
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\components\stage-header'
 @ ./src/components/stage-header/stage-header.jsx 5:0-28 142:27-29
 @ ./src/containers/stage-header.jsx
 @ ./src/components/stage-wrapper/stage-wrapper.jsx
 @ ./src/containers/stage-wrapper.jsx
 @ ./src/components/gui/gui.jsx
 @ ./src/containers/gui.jsx
 @ ./src/playground/blocks-only.jsx

ERROR in ./src/components/stage-wrapper/stage-wrapper.jsx
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\components\stage-wrapper'
 @ ./src/components/stage-wrapper/stage-wrapper.jsx 8:0-28 45:27-29
 @ ./src/containers/stage-wrapper.jsx
 @ ./src/components/gui/gui.jsx
 @ ./src/containers/gui.jsx
 @ ./src/playground/blocks-only.jsx

ERROR in ./src/components/target-pane/target-pane.jsx
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\components\target-pane'
 @ ./src/components/target-pane/target-pane.jsx 7:0-28 147:27-29
 @ ./src/containers/target-pane.jsx
 @ ./src/components/gui/gui.jsx
 @ ./src/containers/gui.jsx
 @ ./src/playground/blocks-only.jsx

ERROR in ./src/containers/controls.jsx
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\containers'
 @ ./src/containers/controls.jsx 21:0-28 74:27-29
 @ ./src/playground/blocks-only.jsx

ERROR in ./src/containers/blocks.jsx
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\containers'
 @ ./src/containers/blocks.jsx 28:0-28 678:27-29
 @ ./src/playground/blocks-only.jsx

ERROR in ./src/containers/gui.jsx
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\containers'
 @ ./src/containers/gui.jsx 23:0-28 136:27-29
 @ ./src/playground/blocks-only.jsx

ERROR in ./src/containers/prompt.jsx
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\containers'
 @ ./src/containers/prompt.jsx 18:0-28 120:27-29
 @ ./src/containers/blocks.jsx
 @ ./src/playground/blocks-only.jsx

ERROR in ./src/containers/extension-library.jsx
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\containers'
 @ ./src/containers/extension-library.jsx 20:0-28 89:27-29
 @ ./src/containers/blocks.jsx
 @ ./src/playground/blocks-only.jsx

ERROR in ./src/containers/costume-tab.jsx
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\containers'
 @ ./src/containers/costume-tab.jsx 21:0-28 361:27-29
 @ ./src/components/gui/gui.jsx
 @ ./src/containers/gui.jsx
 @ ./src/playground/blocks-only.jsx

ERROR in ./src/containers/sound-tab.jsx
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\containers'
 @ ./src/containers/sound-tab.jsx 18:0-28 305:27-29
 @ ./src/components/gui/gui.jsx
 @ ./src/containers/gui.jsx
 @ ./src/playground/blocks-only.jsx

ERROR in ./src/containers/stage-wrapper.jsx
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\containers'
 @ ./src/containers/stage-wrapper.jsx 3:0-28 12:27-29
 @ ./src/components/gui/gui.jsx
 @ ./src/containers/gui.jsx
 @ ./src/playground/blocks-only.jsx

ERROR in ./src/containers/costume-library.jsx
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\containers'
 @ ./src/containers/costume-library.jsx 18:0-28 66:27-29
 @ ./src/components/gui/gui.jsx
 @ ./src/containers/gui.jsx
 @ ./src/playground/blocks-only.jsx

ERROR in ./src/containers/backdrop-library.jsx
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\containers'
 @ ./src/containers/backdrop-library.jsx 18:0-28 67:27-29
 @ ./src/components/gui/gui.jsx
 @ ./src/containers/gui.jsx
 @ ./src/playground/blocks-only.jsx

ERROR in ./src/containers/watermark.jsx
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\containers'
 @ ./src/containers/watermark.jsx 21:0-28 52:27-29
 @ ./src/components/gui/gui.jsx
 @ ./src/containers/gui.jsx
 @ ./src/playground/blocks-only.jsx

ERROR in ./src/containers/backpack.jsx
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\containers'
 @ ./src/containers/backpack.jsx 26:0-28 275:27-29
 @ ./src/components/gui/gui.jsx
 @ ./src/containers/gui.jsx
 @ ./src/playground/blocks-only.jsx

ERROR in ./src/containers/connection-modal.jsx
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\containers'
 @ ./src/containers/connection-modal.jsx 18:0-28 194:27-29
 @ ./src/components/gui/gui.jsx
 @ ./src/containers/gui.jsx
 @ ./src/playground/blocks-only.jsx

ERROR in ./src/containers/paint-editor-wrapper.jsx
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\containers'
 @ ./src/containers/paint-editor-wrapper.jsx 21:0-28 78:27-29
 @ ./src/containers/costume-tab.jsx
 @ ./src/components/gui/gui.jsx
 @ ./src/containers/gui.jsx
 @ ./src/playground/blocks-only.jsx

ERROR in ./src/containers/record-modal.jsx
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\containers'
 @ ./src/containers/record-modal.jsx 17:0-28 159:27-29
 @ ./src/containers/sound-tab.jsx
 @ ./src/components/gui/gui.jsx
 @ ./src/containers/gui.jsx
 @ ./src/playground/blocks-only.jsx

ERROR in ./src/containers/sound-editor.jsx
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\containers'
 @ ./src/containers/sound-editor.jsx 27:0-28 557:27-29
 @ ./src/containers/sound-tab.jsx
 @ ./src/components/gui/gui.jsx
 @ ./src/containers/gui.jsx
 @ ./src/playground/blocks-only.jsx

ERROR in ./src/containers/sound-library.jsx
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\containers'
 @ ./src/containers/sound-library.jsx 24:0-28 214:27-29
 @ ./src/containers/sound-tab.jsx
 @ ./src/components/gui/gui.jsx
 @ ./src/containers/gui.jsx
 @ ./src/playground/blocks-only.jsx

ERROR in ./src/containers/sprite-library.jsx
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\containers'
 @ ./src/containers/sprite-library.jsx 18:0-28 66:27-29
 @ ./src/components/target-pane/target-pane.jsx
 @ ./src/containers/target-pane.jsx
 @ ./src/components/gui/gui.jsx
 @ ./src/containers/gui.jsx
 @ ./src/playground/blocks-only.jsx

ERROR in ./src/containers/stage-header.jsx
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\containers'
 @ ./src/containers/stage-header.jsx 19:0-28 69:27-29
 @ ./src/components/stage-wrapper/stage-wrapper.jsx
 @ ./src/containers/stage-wrapper.jsx
 @ ./src/components/gui/gui.jsx
 @ ./src/containers/gui.jsx
 @ ./src/playground/blocks-only.jsx

ERROR in ./src/containers/stage.jsx
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\containers'
 @ ./src/containers/stage.jsx 35:0-28 501:27-29
 @ ./src/components/stage-wrapper/stage-wrapper.jsx
 @ ./src/containers/stage-wrapper.jsx
 @ ./src/components/gui/gui.jsx
 @ ./src/containers/gui.jsx
 @ ./src/playground/blocks-only.jsx

ERROR in ./src/containers/sprite-selector-item.jsx
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\containers'
 @ ./src/containers/sprite-selector-item.jsx 25:0-28 201:27-29
 @ ./src/components/backpack/backpack.jsx
 @ ./src/containers/backpack.jsx
 @ ./src/components/gui/gui.jsx
 @ ./src/containers/gui.jsx
 @ ./src/playground/blocks-only.jsx

ERROR in ./src/containers/scanning-step.jsx
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\containers'
 @ ./src/containers/scanning-step.jsx 18:0-28 97:27-29
 @ ./src/components/connection-modal/connection-modal.jsx
 @ ./src/containers/connection-modal.jsx
 @ ./src/components/gui/gui.jsx
 @ ./src/containers/gui.jsx
 @ ./src/playground/blocks-only.jsx

ERROR in ./src/containers/auto-scanning-step.jsx
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\containers'
 @ ./src/containers/auto-scanning-step.jsx 18:0-28 106:27-29
 @ ./src/components/connection-modal/connection-modal.jsx
 @ ./src/containers/connection-modal.jsx
 @ ./src/components/gui/gui.jsx
 @ ./src/containers/gui.jsx
 @ ./src/playground/blocks-only.jsx

ERROR in ./src/containers/target-highlight.jsx
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\containers'
 @ ./src/containers/target-highlight.jsx 24:0-28 90:27-29
 @ ./src/components/stage/stage.jsx
 @ ./src/containers/stage.jsx
 @ ./src/components/stage-wrapper/stage-wrapper.jsx
 @ ./src/containers/stage-wrapper.jsx
 @ ./src/components/gui/gui.jsx
 @ ./src/containers/gui.jsx
 @ ./src/playground/blocks-only.jsx

ERROR in ./src/containers/green-flag-overlay.jsx
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\containers'
 @ ./src/containers/green-flag-overlay.jsx 18:0-28 53:27-29
 @ ./src/components/stage/stage.jsx
 @ ./src/containers/stage.jsx
 @ ./src/components/stage-wrapper/stage-wrapper.jsx
 @ ./src/containers/stage-wrapper.jsx
 @ ./src/components/gui/gui.jsx
 @ ./src/containers/gui.jsx
 @ ./src/playground/blocks-only.jsx

ERROR in ./src/containers/monitor.jsx
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\containers'
 @ ./src/containers/monitor.jsx 32:0-28 326:27-29
 @ ./src/components/monitor-list/monitor-list.jsx
 @ ./src/containers/monitor-list.jsx
 @ ./src/components/stage/stage.jsx
 @ ./src/containers/stage.jsx
 @ ./src/components/stage-wrapper/stage-wrapper.jsx
 @ ./src/containers/stage-wrapper.jsx
 @ ./src/components/gui/gui.jsx
 @ ./src/containers/gui.jsx
 @ ./src/playground/blocks-only.jsx

ERROR in ./src/containers/slider-monitor.jsx
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\containers'
 @ ./src/containers/slider-monitor.jsx 21:0-28 76:27-29
 @ ./src/components/monitor/monitor.jsx
 @ ./src/containers/monitor.jsx
 @ ./src/components/monitor-list/monitor-list.jsx
 @ ./src/containers/monitor-list.jsx
 @ ./src/components/stage/stage.jsx
 @ ./src/containers/stage.jsx
 @ ./src/components/stage-wrapper/stage-wrapper.jsx
 @ ./src/containers/stage-wrapper.jsx
 @ ./src/components/gui/gui.jsx
 @ ./src/containers/gui.jsx
 @ ./src/playground/blocks-only.jsx

ERROR in ./src/containers/list-monitor.jsx
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\containers'
 @ ./src/containers/list-monitor.jsx 21:0-28 216:27-29
 @ ./src/components/monitor/monitor.jsx
 @ ./src/containers/monitor.jsx
 @ ./src/components/monitor-list/monitor-list.jsx
 @ ./src/containers/monitor-list.jsx
 @ ./src/components/stage/stage.jsx
 @ ./src/containers/stage.jsx
 @ ./src/components/stage-wrapper/stage-wrapper.jsx
 @ ./src/containers/stage-wrapper.jsx
 @ ./src/components/gui/gui.jsx
 @ ./src/containers/gui.jsx
 @ ./src/playground/blocks-only.jsx

ERROR in ./src/lib/project-saver-hoc.jsx
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\lib'
 @ ./src/lib/project-saver-hoc.jsx 22:0-28 417:29-31
 @ ./src/containers/gui.jsx
 @ ./src/playground/blocks-only.jsx

ERROR in ./src/lib/vm-listener-hoc.jsx
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\lib'
 @ ./src/lib/vm-listener-hoc.jsx 20:0-28 196:29-31
 @ ./src/containers/gui.jsx
 @ ./src/playground/blocks-only.jsx

ERROR in ./src/lib/vm-manager-hoc.jsx
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\lib'
 @ ./src/lib/vm-manager-hoc.jsx 22:0-28 136:29-31
 @ ./src/containers/gui.jsx
 @ ./src/playground/blocks-only.jsx

ERROR in ./src/lib/cloud-manager-hoc.jsx
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\lib'
 @ ./src/lib/cloud-manager-hoc.jsx 22:0-28 157:29-31
 @ ./src/containers/gui.jsx
 @ ./src/playground/blocks-only.jsx

ERROR in ./src/reducers/vm.js
Module not found: Error: Can't resolve 'scratch-vm' in 'E:\Scratch_Mod\scratch-gui\src\reducers'
 @ ./src/reducers/vm.js 1:0-28 4:20-22
 @ ./src/reducers/gui.js
 @ ./src/lib/app-state-hoc.jsx
 @ ./src/playground/index.jsx

i 「wdm」: Failed to compile.

Steps to Reproduce

For the First Approach:

  1. mkdir Scratch
  2. cd Scratch
  3. git clone https://github.com/scratchfoundation/scratch-gui.git
  4. git clone https://github.com/scratchfoundation/scratch-vm.git
  5. cd scratch-vm
  6. npm install
  7. npm link
  8. npm run watch
  9. cd ../scratch-gui
  10. npm install
  11. npm link scratch-vm
  12. npm start

For the Second Approach:

  1. mkdir Scratch
  2. cd Scratch
  3. git clone https://github.com/scratchfoundation/scratch-gui.git
  4. git clone https://github.com/scratchfoundation/scratch-vm.git
  5. cd scratch-vm
  6. npm install
  7. npm link
  8. cd ../scratch-gui
  9. npm install
  10. npm link scratch-vm
  11. npm start

System Details

So I have a Dell G5 5500 with Windows 11
Python 3.12
Java 8
JDK 22
Node Js 21.7.1
npm 10.5.0

@CST1229
Copy link

CST1229 commented Mar 27, 2024

I think doing npm install unlinks everything, use npm ci instead.

@gurumoorty-s
Copy link
Author

Which approach should I follow? First one or the Second one @CST1229 ?

@CST1229
Copy link

CST1229 commented Mar 27, 2024

Which approach should I follow? First one or the Second one @CST1229 ?

second

@gurumoorty-s
Copy link
Author

It Still shows the same error as mentioned in Approach Two. What is the workaround @CST1229 ?

@yangshuaipeng126
Copy link

@gurumoorty-s Hello, I have the same problem. Have you solved it

@jlaungos
Copy link

@gurumoorty-s Hello, have you fixed this issue?

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

4 participants