美文网首页jouypub.com
CentOS上安装remix-ide错误及解决方法

CentOS上安装remix-ide错误及解决方法

作者: JouyPub | 来源:发表于2018-08-04 12:04 被阅读0次

remix-ide安装文档:https://github.com/ethereum/remix-ide

本机环境:

> lsb_release -a
LSB Version:    :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description:    CentOS Linux release 7.4.1708 (Core)
Release:    7.4.1708
Codename:   Core

> node --version
v8.9.3

> npm --version
6.1.0

安装

> npm install remix-ide -g

启动

> remix-ide

然后报错了...,错误信息如下:

Error: Cannot find module './build/Release/scrypt'
    at Function.Module._resolveFilename (module.js:536:15)
    at Function.Module._load (module.js:466:25)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/services/apps/node-v8.9.3-linux-x64/lib/node_modules/remix-ide/node_modules/scrypt/index.js:3:20)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/services/apps/node-v8.9.3-linux-x64/lib/node_modules/remix-ide/node_modules/scrypt.js/node.js:1:76)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/services/apps/node-v8.9.3-linux-x64/lib/node_modules/remix-ide/node_modules/web3-eth-accounts/src/index.js:35:16)
    at Module._compile (module.js:635:30)

看异常信息,应该是缺少scrypt包,检查系统node_modules目录

ll /services/apps/node-v8.9.3-linux-x64/lib/node_modules/

确实没有scrypt

然后安装scrpt
scrpt文档 https://www.npmjs.com/package/scrypt
具体执行步骤:

> npm install -g node-gyp
> npm install -g scrypt

在安装node-gyp时,又报了一个错误:WARN EACCES user “root” does not have permission to access the dev dir
解决方案:https://github.com/nodejs/node-gyp/issues/454
具体解决办法就是安装时加上--unsafe-perm参数

npm install --unsafe-perm --verbose -g node-gyp

安装完scrypt后,执行remix-ide仍然报错,继续探索,终于找到了解决方案
https://github.com/barrysteyn/node-scrypt/issues/108

具体执行

cd /services/apps/node-v8.9.3-linux-x64/lib/node_modules/scrypt
node-gyp configure build

编译成功

最后再执行remix-ide,完美,成功启动

相关文章

网友评论

  • ZJ_Lavender:所以开源的这玩意全是坑,没办法搞个安装包一次性安装好的呀……忧伤
    JouyPub:要兼容那么多软件版本、系统版本,成本是很高的。毕竟开源项目的作者精力有限,不过项目背后有团队的话文档还全一点
  • ZJ_Lavender:不知道这篇文章是否原创,好像百度搜索到的很多相同的内容啊,可能是被抄袭了把
    JouyPub:解决方法都是一样,百度都能搜的到,但是有人写的详细,有人写的模糊
  • ZJ_Lavender:阿里云上完全相同的环境,卡在node与npm的环境配置上了,很伤,写后台平时这个工具用得少
    JouyPub:你那边报的什么错

本文标题:CentOS上安装remix-ide错误及解决方法

本文链接:https://www.haomeiwen.com/subject/hmtmvftx.html