Truffle migrate -- reset command fails at migrating 1_initial_migration.js

Hello, making progress and hit another snag with my moralis rarible clone project following the Moralis YouTube videos.

I am on part 6 of the videos and run the following commnand and cannot complete the migration.



PS C:\Users\Darren\OneDrive - Brickware\Documents\MORALIS\Projects\00\contracts> truffle migrate --reset

Compiling your contracts…

Compiling @openzeppelin\contracts\token\ERC721\ERC721.sol
Compiling @openzeppelin\contracts\token\ERC721\IERC721.sol
Compiling @openzeppelin\contracts\token\ERC721\IERC721Receiver.sol
Compiling @openzeppelin\contracts\token\ERC721\extensions\IERC721Metadata.sol
Compiling @openzeppelin\contracts\utils\Address.sol
Compiling @openzeppelin\contracts\utils\Context.sol
Compiling @openzeppelin\contracts\utils\Counters.sol
Compiling @openzeppelin\contracts\utils\Strings.sol
Compiling @openzeppelin\contracts\utils\introspection\ERC165.sol
Compiling @openzeppelin\contracts\utils\introspection\IERC165.sol
Compiling .\contracts\MorarableToken.sol
Compilation warnings encountered:

Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.

–> project:/contracts/MorarableToken.sol

Artifacts written to C:\Users\Darren\OneDrive - Brickware\Documents\MORALIS\Projects\00\contracts\build\contracts
Compiled successfully using:

  • solc: 0.8.0+commit.c7dfd78e.Emscripten.clang

Starting migrations…

Network name: ‘ganache’
Network id: 5777
Block gas limit: 6721975 (0x6691b7)

1_initial_migration.js

C:\Users\Darren\AppData\Roaming\npm\node_modules\truffle\build\459.bundled.js:27185
throw new Error(“Could not find artifacts for " + import_path + " from any sources”);
^

Error: Could not find artifacts for Migrations from any sources
at Resolver.require (C:\Users\Darren\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\resolver\dist\lib\resolver.js:60:1)
at Object.require (C:\Users\Darren\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\index.js:172:1)
at ResolverIntercept.require (C:\Users\Darren\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\ResolverIntercept.js:22:1)
at C:\Users\Darren\OneDrive - Brickware\Documents\MORALIS\Projects\00\contracts\migrations\1_initial_migration.js:1:30
at Script.runInContext (node:vm:139:12)
at Script.runInNewContext (node:vm:144:17)
at Object.file (C:\Users\Darren\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\require\require.js:94:1)
at Migration._load (C:\Users\Darren\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\Migration.js:44:1)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at Migration.run (C:\Users\Darren\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\Migration.js:217:1)
at Object.runMigrations (C:\Users\Darren\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\index.js:150:1)
at Object.runFrom (C:\Users\Darren\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\index.js:110:1)
at Object.runAll (C:\Users\Darren\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\index.js:114:1)
at Object.run (C:\Users\Darren\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\index.js:79:1)
at runMigrations (C:\Users\Darren\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\core\lib\commands\migrate\run.js:76:1)
at Object.module.exports [as run] (C:\Users\Darren\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\core\lib\commands\migrate\run.js:44:1)
Truffle v5.4.28 (core: 5.4.28)
Node v16.13.1

Hey @DarrenMc, add the license you are using in your project :raised_hands: for example:

// SPDX-License-Identifier: MIT

Thank you, I have entered ‘// SPDX-License-Identifier: MIT’ into my two sol contract files for migrations and morarables as per the Moralis Cloning Rarible part 6 video. I am getting a ‘Could not find suitable configuration file.’ when I try to run the truffle migrate -- reset command in PS. This started happening before I added ‘// SPDX-License-Identifier: MIT’ to the files. Any ideas?

did you have any truffle-config.js?

Thanks for the quick response.

Yes, I have figured it out, needed to run these commands again, looks like their settings do not stick:

npm install --force -g truffle
npm audit fix
truffle init
truffle migrate -- reset

and it worked.

1 Like