求助:安装 remix-ide 时执行 npm start 报错

杰哥Kevin 2018-10-01 10:06:22
环境:ubuntu 16.04

前面的下载都顺利,但 npm start 后就报错,返回如下

[onchange]
[onchange] > remix-ide@0.7.3 onchange /home/kevin/remix-ide
[onchange] > onchange build/app.js -- npm-run-all lint
[onchange]
[serve ]
[serve ] > remix-ide@0.7.3 serve /home/kevin/remix-ide
[serve ] > execr --silent http-server .
[serve ]
[watch ]
[watch ] > remix-ide@0.7.3 watch /home/kevin/remix-ide
[watch ] > watchify src/index.js -dv -p browserify-reload -o build/app.js --exclude solc
[watch ]
[remixd ]
[remixd ] > remix-ide@0.7.3 remixd /home/kevin/remix-ide
[remixd ] > ./node_modules/remixd/bin/remixd -s ./contracts
[remixd ]
[watch ] WS server listening on 34779
[remixd ] module.js:550
[remixd ] throw err;
[remixd ] ^
[remixd ]
[remixd ] Error: Cannot find module 'serve'
[remixd ] at Function.Module._resolveFilename (module.js:548:15)
[remixd ] at Function.Module._load (module.js:475:25)
[remixd ] at Module.require (module.js:597:17)
[remixd ] at require (internal/module.js:11:18)
[remixd ] at Object.<anonymous> (/home/kevin/remix-ide/node_modules/remixd/src/services/startFrontend.js:1:77)
[remixd ] at Module._compile (module.js:653:30)
[remixd ] at Object.Module._extensions..js (module.js:664:10)
[remixd ] at Module.load (module.js:566:32)
[remixd ] at tryModuleLoad (module.js:506:12)
[remixd ] at Function.Module._load (module.js:498:3)
[remixd ] at Module.require (module.js:597:17)
[remixd ] at require (internal/module.js:11:18)
[remixd ] at Object.<anonymous> (/home/kevin/remix-ide/node_modules/remixd/bin/remixd:6:21)
[remixd ] at Module._compile (module.js:653:30)
[remixd ] at Object.Module._extensions..js (module.js:664:10)
[remixd ] at Module.load (module.js:566:32)
[remixd ] at tryModuleLoad (module.js:506:12)
[remixd ] at Function.Module._load (module.js:498:3)
[remixd ] at Function.Module.runMain (module.js:694:10)
[remixd ] at startup (bootstrap_node.js:204:16)
[remixd ] at bootstrap_node.js:625:3
[remixd ] npm ERR! code ELIFECYCLE
[remixd ] npm ERR! errno 1
[remixd ] npm ERR! remix-ide@0.7.3 remixd: `./node_modules/remixd/bin/remixd -s ./contracts`
[remixd ] npm ERR! Exit status 1
[remixd ] npm ERR!
[remixd ] npm ERR! Failed at the remix-ide@0.7.3 remixd script.
[remixd ] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[remixd ]
[remixd ] npm ERR! A complete log of this run can be found in:
[remixd ] npm ERR! /home/kevin/.npm/_logs/2018-10-01T13_40_12_969Z-debug.log
ERROR: "remixd" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! remix-ide@0.7.3 start: `npm-run-all -lpr serve watch onchange remixd`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the remix-ide@0.7.3 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/kevin/.npm/_logs/2018-10-01T13_40_13_348Z-debug.log

百度了一下,似乎是没有 serve 引起,然后
尝试 sudo npm install serve , 有以下提示:

npm WARN eslint-plugin-node@4.2.3 requires a peer of eslint@>=3.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN remix-tests@0.0.13 requires a peer of yo-yoify@latest but none is installed. You must install peer dependencies yourself.
npm WARN The package remixd is included as both a dev and production dependency.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ serve@10.0.2
updated 1 package and audited 400049 packages in 15.515s
found 0 vulnerabilities

但 npm start 还是报错,不知道什么原因,求高人指点
...全文
483 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
qq_42597651 2018-10-19
  • 打赏
  • 举报
回复
顶贴,前排。
本地部署指南 部署合约: 一共部署了3个合约, 其中3个收款地址被砍掉(改成了部署者的地址), p3d 也砍掉了 3个合约 我偷懒没有把合约地址写死, 用的是后续的 set 方法, 所以如果 truffle migrate 最后那段报错了, 可能没有 set 成功, 需要用其他方式调用( truffle console, 或者 remix 等) 合约部署完, 如无报错, 直接复制走 FoMo3Dlong 的地址就行了 npm install ganache-cli -g ganache-cli -l 471238800 -g 1 # 开启 testrpc 同设定 gasLimit 和 gasPrice truffle compile truffle migrate --reset # 执行后, 复制 FoMo3Dlong: 后跟的地址 #直接输出最终合约地址, 将不会打印编译过程 truffle migrate --reset | grep 'FoMo3Dlong: 0x' | awk '{ print $2 }' 推荐做法 truffle migrate --reset > migrate.log cat migrate.log # 查看有无错误, 如合约均部署成功,但最后报错, 可能有几个赋值方法没有执行(我部署到 kovan 就发生了这事,可以参考 migrations/2_deploy_fomo3d.js逻辑手动执行) cat migrate.log | grep 'FoMo3Dlong: 0x' | awk '{ print $2 }' 部署前端: 前端没有太多需要改的地方, 若使用英文版, 可参考下面命令行修改地址方式 若选择 bundle-cn.js 这个中文版, 则自己找到要修改的地方, 手动修改也行的 顺便说下 cn 里面还是 kovan测试网络的配置, 如需使用可把 bundle.js 里面的本地配置拷贝下 cd src/js sed -i "" 's/{{address}}/0x00/g' bundle.js # 非 mac 去除 -i 后的 "" cd ../../ npm install & npm run start 游戏激活(不激活就处于 ICO 中? 不懂...) 刚想到一个不一定靠谱的简单方式, 把 migrations 下那个 js 里面加一个 activate 的方法调用 npm install remix-ide -g # 安装个本地的 remix-ide remix-ide #注意此处于项目根目录 OK, 浏览器访问 remix-ide, 点击左上角第6个图标( Connect to localhost ), 弹框继续 connect 左边多出 localhost, 点击 contracts 下的 FoMo3Dlong.sol 文件, ctrl + s , 触发编译 , 下一步 点击右边的上边的 Run, 选择 web3 provider, 如端口不变, 一路 next, ok, 往下看, 有个选择 合约的 select, 选中 FoMo3Dlong, 然后在 输入框中输入 migrate 得到的合约地址, 然后点击 At Address 最后点下 合约的 activate 方法 合约源码浅度分析 Fomo3D 合约源码分析 主要是对源码所有合约整理归类, 解释下合约都有啥作用, 希望对刚接触 fomo3d, 想学习 fomo3d 的有所帮助!

791

社区成员

发帖
与我相关
我的任务
社区描述
区块链技术专区
区块链 技术论坛(原bbs)
社区管理员
  • 区块链技术
  • ccc908
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧