I'm trying to run truffle migrate
on two js files: 1_initial_migration.js
and 2_deploy_contracts.js
. I can successfully compile my .sol
files to .json
ABIs but then when I try to migrate
I get the following error:
const Migrations = artifacts.require("Migrations");
^
TypeError: Cannot read property 'require' of undefined
Here's how I've utilised artifacts
in my js files:
const { artifacts } = require("truffle");
const Migrations = artifacts.require("Migrations");
truffle version
results are as follows:
Truffle v5.1.39 (core: 5.1.39)
Solidity v0.5.16 (solc-js)
Node v14.16.0
Web3.js v1.2.1
Also I'm following this course on youtube.
I've seen a couple of posts about changing solitidy version, solc(?) version, and truffle version. I've tried downgrading my global truffle version to 5.1.39 and upgrading the solidity version at the start of my .sol
files to ^0.6.0, as that seems to be the recommendations from those posts: