I'm getting an error when I run truffle build on Node v6.0.0.
It does not occur on Node v5.5.0.
$ truffle build
(node) v8::ObjectTemplate::Set() with non-primitive values is deprecated
(node) and will stop working in the next major release.
==== JS stack trace =========================================
Security context: 0x1ce7860c9fa9 <JS Object>#0#
1: .node [module.js:568] [pc=0x2a8e05464be4] (this=0x777f4b28f1 <an Object with map 0x368b92e8e821>#1#,module=0xf96356208d9 <a Module with map 0x368b92e181b9>#2#,filename=0xf96356208b1 <String[134]: /Users/raine/.nvm/versions/node/v6.0.0/lib/node_modules/truffle/node_modules/fsevents/lib/binding/Release/node-v48-darwin-x64/fse.node>)
2: load [module.js:~447] [pc=0x2a8e053f6496] (this=0xf96356208d9 <a Module with map 0x368b92e181b9>#2#,filename=0xf96356208b1 <String[134]: /Users/raine/.nvm/versions/node/v6.0.0/lib/node_modules/truffle/node_modules/fsevents/lib/binding/Release/node-v48-darwin-x64/fse.node>)
3: tryModuleLoad(aka tryModuleLoad) [module.js:415] [pc=0x2a8e0523899d] (this=0x1ce786004189 <undefined>,module=0xf96356208d9 <a Module with map 0x368b92e181b9>#2#,filename=0xf96356208b1 <String[134]: /Users/raine/.nvm/versions/node/v6.0.0/lib/node_modules/truffle/node_modules/fsenvm/versions/node/v6.0.0/lib/node_modules/truffle/node_modules/babel-register/lib/node.js:134] [pc=0x2a8e053a5f54] (this=0x777f4b28f1 <an Object with map 0x368b92e8e821>#1#,m=0xf9635436219 <a Module with map 0x368b92e181b9>#8#,filename=0xf96354361f1 <String[109]: /Users/raine/.nvm/versions/node/v6.0.0/lib/node_modules/truffle/node_modules/chokidar/lib/fsevents-handler.js>)
20: load [module.js:~447] [pc=0x2a8e053f6496] (this=0xf9635436219 <a Module with map 0x368b92e181b9>#8#,filename=0xf96354361f1 <String[109]: /Users/raine/.nvm/versions/node/v6.0.0/lib/node_modules/truffle/node_modules/chokidar/lib/fsevents-handler.js>)
21: tryModuleLoad(aka tryModuleLoad) [module.js:415] [pc=0x2a8e0523899d] (this=0x1ce786004189 <undefined>,module=0xf9635436219 <a Module with map 0x368b92e181b9>#8#,filename=0xf96354361f1 <String[109]: /Users/raine/.nvm/versions/node/v6.0.0/lib/node_modules/truffle/node_modules/chokidar/lib/fsevents-handler.js>)
22: _load [module.js:~381] [pc=0x2a8e05370687] (this=0x777f4b28a9 <JS 1: v8::Template::Set(v8::Local<v8::Name>, v8::Local<v8::Data>, v8::PropertyAttribute)
2: fse::FSEvents::Initialize(v8::Local<v8::Object>)
3: node::DLOpen(v8::FunctionCallbackInfo<v8::Value> const&)
4: v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo<v8::Value> const&))
5: v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::(anonymous namespace)::BuiltinArguments<(v8::internal::BuiltinExtraArguments)1>)
6: v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*)
7: 0x2a8e0510961b
8: 0x2a8e05464be4
(node) v8::ObjectTemplate::Set() with non-primitive values is deprecated
(node) and will stop working in the next major release.
==== JS stack trace =========================================
Security context: 0x1ce7860c9fa9 <JS Object>#0#
1: .node [module.js:568] [pc=0x2a8e05464be4] (this=0x777f4b28f1 <an Object with map 0x368b92e8e821>#1#,module=0xf96356208d9 <a Module with map 0x368b92e181b9>#2#,filename=0xf96356208b1 <String[134]: /Users/raine/.nvm/versions/node/v6.0.0/lib/node_modules/truffle/node_modules/fsevents/lib/binding/Release/node-v48-darwin-x64/fse.node>)
2: load [module.js:~447] [pc=0x2a8e053f6496] (this=0xf96356208d9 <a Module with map 0x368b92e181b9>#2#,filename=0xf96356208b1 <String[134]: /Users/raine/.nvm/versions/node/v6.0.0/lib/node_modules/truffle/node_modules/fsevents/lib/binding/Release/node-v48-darwin-x64/fse.node>)
3: tryModuleLoad(aka tryModuleLoad) [module.js:415] [pc=0x2a8e0523899d] (this=0x1ce786004189 <undefined>,module=0xf96356208d9 <a Module with map 0x368b92e181b9>#2#,filename=0xf96356208b1 <String[134]: /Users/raine/.nvm/versions/node/v6.0.0/lib/node_modules/truffle/node_modules/fse 1: v8::Template::Set(v8::Local<v8::Name>, v8::Local<v8::Data>, v8::PropertyAttribute)
2: fse::FSEvents::Initialize(v8::Local<v8::Object>)
3: node::DLOpen(v8::FunctionCallbackInfo<v8::Value> const&)
4: v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo<v8::Value> const&))
5: v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::(anonymous namespace)::BuiltinArguments<(v8::internal::BuiltinExtraArguments)1>)
6: v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*)
7: 0x2a8e0510961b
8: 0x2a8e05464be4
TypeError: Path must be a string. Received undefined
at assertPath (path.js:7:11)
at Object.dirname (path.js:1324:5)
at Module._compile (module.js:536:22)
at /Users/raine/.nvm/versions/node/v6.0.0/lib/node_modules/truffle/node_modules/ether-pudding/loader.js:49:11
at /Users/raine/.nvm/versions/node/v6.0.0/lib/node_modules/truffle/node_modules/ether-pudding/loader.js:30:7
at done (/Users/raine/.nvm/versions/node/v6.0.0/lib/node_modules/truffle/node_modules/node-dir/lib/paths.js:27:13)
at /Users/raine/.nvm/versions/node/v6.0.0/lib/node_modules/truffle/node_modules/node-dir/lib/paths.js:55:33
at FSReqWrap.oncomplete (fs.js:117:15)
at Function.module.exports.loopWhile (/Users/raine/.nvm/versions/node/v6.0.0/lib/node_modules/truffle/node_modules/deasync/index.js:72:22)
at /Users/raine/.nvm/versions/node/v6.0.0/lib/node_modules/truffle/node_modules/deasync/index.js:44:19
at Object.Config.gather (/Users/raine/.nvm/versions/node/v6.0.0/lib/node_modules/truffle/li
I get the same on deploy using v6.0.
edit:
I can confirm it works with v5.5
I had the same with node v6.1.0 using truffle deploy
So I tried to compile again and truffle compile gave me this error too but ti worked on the first time.
So I deleted my project and launched truffle init again and immediately launcher truffle deploy and it works fine. It seems that something is broken by the compile process... then any truffle command is broken.
I'm getting a similar error when I clone the truffle repo, run node ./cli.js test (which succeeds), but then when I run node ./cli.js test again, it fails with:
TypeError: Path must be a string. Received undefined
at assertPath (path.js:7:11)
at Object.dirname (path.js:1324:5)
at Module._compile (module.js:536:22)
at /Users/davehoover/Projects/truffle/node_modules/ether-pudding/loader.js:49:11
at /Users/davehoover/Projects/truffle/node_modules/ether-pudding/loader.js:30:7
at done (/Users/davehoover/Projects/truffle/node_modules/node-dir/lib/paths.js:27:13)
at /Users/davehoover/Projects/truffle/node_modules/node-dir/lib/paths.js:55:33
at FSReqWrap.oncomplete (fs.js:117:15)
at Function.module.exports.loopWhile (/Users/davehoover/Projects/truffle/node_modules/deasync/index.js:72:22)
at /Users/davehoover/Projects/truffle/node_modules/deasync/index.js:44:19
at Object.gather (config.js:304:5)
at /Users/davehoover/Projects/truffle/cli.js:251:31
at /Users/davehoover/Projects/truffle/node_modules/deasync/index.js:43:7
at runTask (/Users/davehoover/Projects/truffle/cli.js:46:12)
If I do a git status, it tells me that environments/test/contracts/ is untracked. If I delete that directory, then node ./cli.js test succeeds again.
It appears the problem is in ether-pudding's PuddingLoader. The call to Module._compile should be given a path to the module file.
I am having this problem as well, I cannot run truffle build or truffle test
I tried reinstalling truffle, no luck :(
I got truffle working again by reverting node to v5.5
This has been fixed in this commit / [email protected] : https://github.com/ConsenSys/ether-pudding/pull/25
Since this is a bugfix release of ether-pudding, uninstall truffle then reinstall it again to ensure ether-pudding gets updated:
$ npm uninstall -g truffle
$ npm install -g truffle
Special thanks to @redsquirrel. Will close ticket. Please reopen if you continue to see the issue.
:+1:
On Wed, May 11, 2016 at 10:19 AM Tim Coulter [email protected]
wrote:
This has been fixed in this commit / [email protected] :
ConsenSys/ether-pudding#25
https://github.com/ConsenSys/ether-pudding/pull/25Since this is a bugfix release of ether-pudding, uninstall truffle then
reinstall it again to ensure ether-pudding gets updated:$ npm uninstall -g truffle
$ npm install -g truffleSpecial thanks to @redsquirrel https://github.com/redsquirrel. Will
close ticket. Please reopen if you continue to see the issue.—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
https://github.com/ConsenSys/truffle/issues/147#issuecomment-218511276
Most helpful comment
It appears the problem is in ether-pudding's
PuddingLoader. The call toModule._compileshould be given a path to the module file.