How to fix npm run serve command bringing Relative Module was not found error

Viewed 420

I have a blockchain project whose frontend is implemented in Vuejs. I have installed all the dependencies with "npm install" command. I am trying to set up the development server to serve the front end by running the "npm run serve" command in the /appvue root folder but get a compilation error as follows:

This relative module was not found:

  • ../../build/contracts/SupplyChain.json in ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/App.vue?vue&type=script&lang=js&

I am new to VueJs but it looks like the Supplychain.json file cannot be found yet its clearly in the project structure attached.

https://github.com/kafukoM/project_3_Dapp_Supply_Chain

1 Answers

you need to replace line with import in your App.vue file line № 209 from this

import supplyChainArtifact from '../../../build/contracts/SupplyChain.json'

to

import supplyChainArtifact from '../../app/src/SupplyChain.json'
Related