When truffle is migrating the migrate contract, it sometimes reports "Could not find artifacts for "+ import_path +" from any sources"", as shown in Figure (1):
In fact, it is because can not find the contract documents and error . Let's look at the third sentence: "Error: Could not find artifacts for ZhouWuToken from any sources" This line tells us that the contract file ZhouWuToken cannot be found. The following three places need to be modified:
1) Under the project path/contracts, there must be a ZhouWuToken.sol file, as shown in Figure (2):
2) Project path/migrations/2_deploy_contracts.js, modify as follows:
//Project path/migrations/2_deploy_contracts.js
const ZhouWuToken = artifacts.require("ZhouWuToken");
module.exports = function(deployer) {
deployer.deploy(ZhouWuToken);
};
In the *.js of the migration contract, all are changed to the full name of Token , as shown in Figure (3):
3) In the ZhouWuToken.sol file of the contract itself, the contract function should be named after the full name of the Token, namely contract ZhouWuToken, as shown in Figure (4):