Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

truffle exec doesn't let me use core modules #259

Closed
tomconte opened this issue Sep 5, 2016 · 2 comments
Closed

truffle exec doesn't let me use core modules #259

tomconte opened this issue Sep 5, 2016 · 2 comments
Labels

Comments

@tomconte
Copy link

tomconte commented Sep 5, 2016

My script contains:

var fs = require('fs');
var crypto = require('crypto');

When I try to run it, I get an error for module 'fs':

C:\Development\BlockChain\ethereum-fossilizer>truffle.cmd exec watcher.js
C:\Users\tconte\AppData\Roaming\npm\node_modules\truffle\lib\require.js:60
              throw e;
              ^

Error: Cannot find module 'C:\Development\BlockChain\ethereum-fossilizer\node_modules\fs'
    at Function.Module._resolveFilename (module.js:440:15)
    at Function.Module._load (module.js:388:25)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at context.require (C:\Users\tconte\AppData\Roaming\npm\node_modules\truffle\lib\require.js:55:22)
    at C:\Development\BlockChain\ethereum-fossilizer\watcher.js:1:10
    at ContextifyScript.Script.runInContext (vm.js:35:29)
    at ContextifyScript.Script.runInNewContext (vm.js:41:15)
    at C:\Users\tconte\AppData\Roaming\npm\node_modules\truffle\lib\require.js:80:14
    at tryToString (fs.js:455:3)
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:442:12)

@tcoulter
Copy link
Contributor

tcoulter commented Sep 6, 2016

This is a good bug, thanks for reporting. Similar to #255, will be fixed at the same time.

@tcoulter tcoulter added the bug label Sep 6, 2016
adria0 pushed a commit to adria0/truffle that referenced this issue Nov 13, 2016
@tcoulter tcoulter added this to the 3.0.0 milestone Dec 20, 2016
@tcoulter
Copy link
Contributor

This is fixed by Truffle 3.1.10 (beta). Will go out as an official release within the next day or so: https://github.com/trufflesuite/truffle/releases/tag/3.1.10

Thanks for the report!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants