?一、安装nodejs
yum -y install gcc make gcc-c++ openssl-devel wget
下载源码及解压:
wget http://nodejs.org/dist/v0.10.26/node-v0.10.26.tar.gz
tar -zvxf node-v0.10.26.tar.gz
进入node目录:
cd node-v0.10.26
编译及安装:
make && make install
验证是否安装配置成功:
node -v
安装n模块:
npm install -g n
升级node.js到最新稳定版
n stable
二、安装git
查看是否安装过git:
git --version
?若出现以上版本号,则代表已经安装了git,不需要再次安装了,否则就安装。
三、命令行安装 remix-ide
npm install remix-ide -g
remix-ide
?出现如下报错:
Error: Cannot find module 'remixd'
Require stack:
- /usr/local/lib/node_modules/remix-ide/bin/remix-ide
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/usr/local/lib/node_modules/remix-ide/bin/remix-ide:4:14)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/usr/local/lib/node_modules/remix-ide/bin/remix-ide' ]
}
由于我没时间进一步研究这个代码,只知道这个包的主要作用是方便导入文件,因此直接屏蔽相关代码,在/usr/local/lib/node_modules/remix-ide/bin/remix-ide文件中去除关于remixd的内容。
去除之前:
#!/usr/bin/env node
var path = require('path')
var httpServer = require('http-server')
var remixd = require('remixd')
var server = httpServer.createServer({
root: path.join(__dirname, '/../')
})
var folder = process.argv.length > 2 ? process.argv[2] : process.cwd()
server.listen(8080, '127.0.0.1', function () {})
var router = new remixd.Router(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)
})
router.start()
console.log('\x1b[33m%s\x1b[0m', 'Starting Remix IDE at http://localhost:8080 and sharing ' + folder)
去除之后:
#!/usr/bin/env node
var path = require('path')
var httpServer = require('http-server')
var server = httpServer.createServer({
root: path.join(__dirname, '/../')
})
var folder = process.argv.length > 2 ? process.argv[2] : process.cwd()
server.listen(8080, '127.0.0.1', function () {})
console.log('\x1b[33m%s\x1b[0m', 'Starting Remix IDE at http://localhost:8080 and sharing ' + folder)
再启动remix-ide成功运行
访问 http://localhost:8080
|