./node_modules/ipfs-api/src/utils/module-config.js:7



我是新来的编码和通用。我想做一个项目。。。在我的VirtualMachine(linux/Deb(中,我可以打开我的项目(站点(,但我不能在本地网络中打开它(从另一台计算机,但在同一个Lnetwork中(。。。

我试试这个项目(https://github.com/RumeelHussain/Consensys-Academy-Dev-BootCamp-2018-Final-Project/tree/master/Consensys-Academy-Dev-BootCamp-2018-RumeelHussain-Final-Project)

iam使用节点:v8.11.4Npm:5.6.0松露:v4.1.14Solidity:v0.4.24

当我开始我的项目时,我采取这个

Compiled successfully!
You can now view react-box in the browser.
Local:            http://localhost:xxxx/
On Your Network:  http://xxx.xxx.x.xxx:xxxx/
Note that the development build is not optimized.
To create a production build, use npm run build.

很好!!!!但在另一台计算机中,index.html显示

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#000000">
<!--
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="sys.png">
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Mew</title>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>

当我按下命令(npm运行build(时,我会出现错误

错误:

节点脚本/build.js

Creating an optimized production build...
Failed to compile.
Failed to minify the code from this file: 
./node_modules/ipfs-api/src/utils/module-config.js:7 

在文件/module-config.js中代码:

'use strict'
const getConfig = require('./default-config')
const sendRequest = require('./send-request')
const multiaddr = require('multiaddr')
module.exports = (arg) => {
const config = getConfig()
if (typeof arg === 'function') {
return arg
} else if (typeof arg === 'object') {
return sendRequest(arg)
} else if (typeof arg === 'string') {
const maddr = multiaddr(arg).nodeAddress()
config.host = maddr.address
config.port = maddr.port
return sendRequest(config)
} else {
throw new Error('Argument must be a send function or a config object.')
}
}

我阅读了关于那个错误的一般性主题,但没有得到积极的结果。。。如果有人帮助我,我非常感激!!!谢谢

此包已被弃用

ipfsapi已重命名为ipfshttp客户端,请更新您的package.json以获得最新版本。

npm install --save ipfs-http-client

相关内容

最新更新