2

Hi I'm having an error with installing ipfs-core into my existing project. I'm using node v16.14.2 and npm v8.5.0. I've tested with a fresh project and just installing ipfs-core and somehow that worked, I feel as if this is an issue with webpack possibly.

The error that I am getting is:

Failed to compile.

./node_modules/ipfs-core/src/components/libp2p.js
Module not found: Can't resolve '@chainsafe/libp2p-noise' in 'C:\Projects\testingIPFS\node_modules\ipfs-core\src\components'

My package.json:

{
  "name": "ipfs-test",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@3id/connect": "^0.4.1",
    "@3id/did-provider": "^0.4.1",
    "@apollo/client": "^3.6.9",
    "@ceramicnetwork/3id-did-resolver": "^2.1.4",
    "@ceramicnetwork/http-client": "^2.3.1",
    "@ceramicstudio/idx": "^0.12.2",
    "@chainsafe/libp2p-noise": "^8.0.0",
    "@emotion/react": "^11.10.0",
    "@emotion/styled": "^11.10.0",
    "@ethersproject/providers": "^5.6.8",
    "@ethersproject/wallet": "^5.6.2",
    "@imtbl/imlogging": "^1.0.37",
    "@imtbl/imx-contracts": "^1.0.1",
    "@imtbl/imx-sdk": "^1.24.1",
    "@metamask/detect-provider": "^1.2.0",
    "@mui/icons-material": "^5.8.4",
    "@mui/material": "^5.10.0",
    "@openzeppelin/contracts": "^4.7.3",
    "@pinata/sdk": "^1.1.26",
    "@reach/router": "^1.3.4",
    "@reduxjs/toolkit": "^1.8.4",
    "@rpldy/upload-button": "^1.0.1",
    "@rpldy/upload-preview": "^1.0.1",
    "@rpldy/uploady": "^1.0.1",
    "@self.id/framework": "^0.3.2",
    "@sendgrid/mail": "^7.7.0",
    "@svgr/cli": "^6.3.1",
    "@testing-library/jest-dom": "^5.16.5",
    "@testing-library/react": "^13.3.0",
    "@testing-library/user-event": "^14.4.3",
    "@types/jest": "^28.1.6",
    "@types/node": "^18.7.3",
    "@types/react": "^18.0.17",
    "@types/react-dom": "^18.0.6",
    "@walletconnect/web3-provider": "^1.8.0",
    "assert": "^2.0.0",
    "authereum": "^0.1.14",
    "axios": "^0.27.2",
    "bitski": "^0.16.1",
    "blockies-ts": "^1.0.0",
    "browserify-zlib": "^0.2.0",
    "buffer": "^6.0.3",
    "buffer-browserify": "^0.2.5",
    "chai": "4.3.6",
    "chai-as-promised": "7.1.1",
    "check-prop-types": "^1.1.2",
    "dids": "^3.2.0",
    "eth-price": "^0.1.5",
    "ethers": "^5.6.9",
    "formik": "^2.2.9",
    "fortmatic": "^2.4.0",
    "get-eth-price": "^1.0.0",
    "graphql": "^16.5.0",
    "i18next": "^21.9.0",
    "ipfs-core": "^0.15.4",
    "ipfs-http-client": "^33.1.1",
    "key-did-provider-ed25519": "^2.0.1",
    "key-did-resolver": "^2.0.6",
    "libp2p-noise": "^4.0.0",
    "metamask-extension-provider": "^3.0.0",
    "mime": "^3.0.0",
    "moment-timezone": "^0.5.34",
    "msw": "^0.44.2",
    "node-polyfill-webpack-plugin": "^2.0.1",
    "npm-check-updates": "^16.0.5",
    "query-string": "^7.1.1",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-dotenv": "^0.1.3",
    "react-dropzone": "^14.2.2",
    "react-grid-layout": "^1.3.4",
    "react-grid-system": "^8.1.6",
    "react-i18next": "^11.18.3",
    "react-icons": "^4.4.0",
    "react-markdown": "^8.0.3",
    "react-pdf": "^5.7.2",
    "react-phone-number-input": "^3.2.7",
    "react-redux": "^8.0.2",
    "react-responsive": "^8.2.0",
    "react-router-dom": "^6.3.0",
    "react-scripts": "4.0.3",
    "react-select": "^5.4.0",
    "react-test-renderer": "^18.2.0",
    "react-toastify": "^9.0.8",
    "reactstrap": "^9.1.3",
    "redux": "^4.2.0",
    "redux-mock-store": "^1.5.4",
    "requirejs": "^2.3.6",
    "styled-components": "^5.3.5",
    "truffle": "^5.5.26",
    "truffle-contract": "^4.0.31",
    "truffle-hdwallet-provider": "^1.0.17",
    "typescript": "^4.2.4",
    "universal-cookie": "^4.0.4",
    "web-vitals": "^2.1.4",
    "web3": "^1.7.5",
    "web3modal": "^1.9.7",
    "yup": "^0.32.11"
  },
  "scripts": {
    "start": "react-app-rewired start",
    "build": "react-app-rewired build",
    "test": "react-app-rewired test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ],
    "rules": {
      "no-unused-vars": "off"
    }
  },
  "browserslist": [
    ">0.2%",
    "not dead",
    "not op_mini all"
  ],
  "devDependencies": {
    "@types/ethereumjs-util": "^6.1.0",
    "@types/styled-components": "^5.1.26",
    "react-app-rewired": "^2.2.1"
  }
}

My config-overrides.js:

module.exports = function override(webpackConfig) {
    webpackConfig.module.rules.push({
      test: /\.mjs$/,
      include: /node_modules/,
      type: "javascript/auto"
    });
    return webpackConfig;
  }

Let me know if I've forgotten to include any other details, Thanks!

scoot556
  • 65
  • 5

0 Answers0