Skip to main content
added 297 characters in body
Source Link
mzaidi
  • 1k
  • 2
  • 15
  • 36

I am trying to execute a script in my truffle project. The script is located in the scripts folder. But whether I run the command from within the root of the project or inside the scripts folder, it cant seem to find my file NiftRouter01.sol which is located in another project. I am using command truffle exec deploy-pool'.js --network bscTestnet and truffle exec scripts/deploy-pooldeploy_pool.jsjs' --network bscTestnet

PS DC:\Blockchain\pancake\pancakeswap-core\scripts>\Users\DELL\AppData\Roaming\npm\node_modules\truffle\build\commands.bundled.js:455204
 truffle exec deploy-pool.js --network bscTestnet   throw new Error("Could not find artifacts for " + import_path + " from any sources");
Using network 'bscTestnet'.      ^

Error: ENOENT:Could nonot suchfind fileartifacts orfor directory,../../niftswap-periphery/build/contracts/NiftRouter01.json openfrom 'Dany sources
    at Resolver.require (C:\Users\DELL\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\resolver\dist\lib\resolver.js:43:1)
    at D:\Blockchain\pancake\pancakeswap-core\scripts\deploy-poolcore\scripts\deploy_pool.js'js:2:26
    at ObjectScript.openSyncrunInContext (fsvm.js:458131:320)
    at ObjectScript.readFileSyncrunInNewContext (fsvm.js:360137:3517)
    at Object.file (C:\Users\DELL\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\require\require.js:2894:1)    
    at Object.exec (C:\Users\DELL\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\require\require.js:121:1)   
    at internal/util.js:297:30
    at new Promise (<anonymous>)
    at bound exec (internal/util.js:296:12)
    at C:\Users\DELL\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\core\lib\commands\exec.js:88:1
Truffle v5.1.49 (core: 5.1.49)
Node v12.18.0

I am trying to execute a script in my truffle project. The script is located in the scripts folder. But whether I run the command from within the root of the project or inside the scripts folder, it cant seem to find my file. I am using command truffle exec deploy-pool.js --network bscTestnet and truffle exec scripts/deploy-pool.js --network bscTestnet

PS D:\Blockchain\pancake\pancakeswap-core\scripts> truffle exec deploy-pool.js --network bscTestnet
Using network 'bscTestnet'.

Error: ENOENT: no such file or directory, open 'D:\Blockchain\pancake\pancakeswap-core\scripts\deploy-pool.js'
    at Object.openSync (fs.js:458:3)
    at Object.readFileSync (fs.js:360:35)
    at Object.file (C:\Users\DELL\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\require\require.js:28:1)    
    at Object.exec (C:\Users\DELL\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\require\require.js:121:1)   
    at internal/util.js:297:30
    at new Promise (<anonymous>)
    at bound exec (internal/util.js:296:12)
    at C:\Users\DELL\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\core\lib\commands\exec.js:88:1
Truffle v5.1.49 (core: 5.1.49)
Node v12.18.0

I am trying to execute a script in my truffle project. The script is located in the scripts folder. But whether I run the command from within the root of the project or inside the scripts folder, it cant seem to find my file NiftRouter01.sol which is located in another project. I am using command truffle exec './deploy_pool.js' --network bscTestnet

C:\Users\DELL\AppData\Roaming\npm\node_modules\truffle\build\commands.bundled.js:455204
        throw new Error("Could not find artifacts for " + import_path + " from any sources");
        ^

Error: Could not find artifacts for ../../niftswap-periphery/build/contracts/NiftRouter01.json from any sources
    at Resolver.require (C:\Users\DELL\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\resolver\dist\lib\resolver.js:43:1)
    at D:\Blockchain\pancake\pancakeswap-core\scripts\deploy_pool.js:2:26
    at Script.runInContext (vm.js:131:20)
    at Script.runInNewContext (vm.js:137:17)
    at Object.file (C:\Users\DELL\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\require\require.js:94:1)    
    at Object.exec (C:\Users\DELL\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\require\require.js:121:1)   
    at internal/util.js:297:30
    at new Promise (<anonymous>)
    at bound exec (internal/util.js:296:12)
    at C:\Users\DELL\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\core\lib\commands\exec.js:88:1
Truffle v5.1.49 (core: 5.1.49)
Node v12.18.0
Source Link
mzaidi
  • 1k
  • 2
  • 15
  • 36

Truffle cant find script file

I am trying to execute a script in my truffle project. The script is located in the scripts folder. But whether I run the command from within the root of the project or inside the scripts folder, it cant seem to find my file. I am using command truffle exec deploy-pool.js --network bscTestnet and truffle exec scripts/deploy-pool.js --network bscTestnet

PS D:\Blockchain\pancake\pancakeswap-core\scripts> truffle exec deploy-pool.js --network bscTestnet
Using network 'bscTestnet'.

Error: ENOENT: no such file or directory, open 'D:\Blockchain\pancake\pancakeswap-core\scripts\deploy-pool.js'
    at Object.openSync (fs.js:458:3)
    at Object.readFileSync (fs.js:360:35)
    at Object.file (C:\Users\DELL\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\require\require.js:28:1)    
    at Object.exec (C:\Users\DELL\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\require\require.js:121:1)   
    at internal/util.js:297:30
    at new Promise (<anonymous>)
    at bound exec (internal/util.js:296:12)
    at C:\Users\DELL\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\core\lib\commands\exec.js:88:1
Truffle v5.1.49 (core: 5.1.49)
Node v12.18.0