ethereum / remix-project

Remix is a browser-based compiler and IDE that enables users to build Ethereum contracts with Solidity language and to debug transactions.
https://remix-ide.readthedocs.io
MIT License
2.36k stars 888 forks source link

TypeError: remixd.Router is not a constructor #1024

Open yjxiao123 opened 3 years ago

yjxiao123 commented 3 years ago

can not install remix by npm . i run "npm install -g remix-ide" successfully,but when i run "remix-ide",it doesnt work. here is the error log: TypeError: remixd.Router is not a constructor at Object. (/usr/local/lib/node_modules/remix-ide/bin/remix-ide:13:14) at Module._compile (internal/modules/cjs/loader.js:1063:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10) at Module.load (internal/modules/cjs/loader.js:928:32) at Function.Module._load (internal/modules/cjs/loader.js:769:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) at internal/main/run_main_module.js:17:47

doncesarts commented 3 years ago

If you modify the binary file from remixd.Router to remixd.Websocket it will run as expected.

var router = new remixd.Websocket(65520, remixd.services.sharedFolder, { remixIdeUrl: 'http://localhost:8080' }, (webSocket) => {
  remixd.services.sharedFolder.setWebSocket(webSocket)
  remixd.services.sharedFolder.setupNotifications(folder)
  remixd.services.sharedFolder.sharedFolder(folder, false)
})

The change on the repo needs to be done here https://github.com/ethereum/remix-project/blob/master/apps/remix-ide/bin/remix-ide