Truffle can not find artifacts error

0 votes

I have written a smart contract and try to run it using truffle. When I try to migrate the project, I am getting the following error:

Error encountered, bailing. Network state unknown. Review successful transactions manually. Error: Could not find artifacts for ./Migrations.sol from any sources at Resolver.require (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:69108:9)

Please help.

Jan 23 in Blockchain by Saloni
315 views

1 answer to this question.

0 votes

To deploy any project/ smart contract, you need Migrations.sol. You can not migrate/ deploy without that. If you have run truffle init, you will have a default file. If not, you have to create this file under contracts directory with the following content:

var Adoption = artifacts.require("MyToken.sol");

module.exports = function(deployer) {

    deployer.deploy(Adoption);

};

Replace require field with the name of contract you have used. 

answered Jan 23 by Omkar
• 68,180 points

Related Questions In Blockchain

+1 vote
5 answers

How to solve "truffle: command not found" error in blockchain?

First try restarting the system and then ...READ MORE

answered Jul 16, 2018 in Blockchain by slayer
• 29,240 points
1,095 views
0 votes
1 answer

Truffle tutorials "Error:recipient address is not a contract address"

It appears like you have already migrated ...READ MORE

answered Aug 8, 2018 in Blockchain by slayer
• 29,240 points
224 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,810 points
184 views
0 votes
1 answer
0 votes
1 answer
0 votes
2 answers

Truffle console error: Could not find suitable configuration file

First, initialize truffle project by running: $ truffle ...READ MORE

answered Feb 19 in Blockchain by John
774 views
0 votes
1 answer

Truffle init: Error: Cannot find module 'original-require'

I think you need to run this ...READ MORE

answered Oct 24, 2018 in Blockchain by Omkar
• 68,180 points
199 views