question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Node v6: "TypeError: Path must be a string. Received undefined"

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:5
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
redsquirrelcommented, May 8, 2016

It appears the problem is in ether-pudding’s PuddingLoader. The call to Module._compile should be given a path to the module file.

1reaction
NicolasMassartcommented, May 7, 2016

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - TypeError: Path must be a string. Received undefined
I a persistent error while using serverless framework with serverless-offline and jest unit testing module.
Read more >
Node.js – babel + path + node 6.x: TypeError - iTecNote
Node.js – babel + path + node 6.x: TypeError: Path must be a string. Received undefined. babeljsnode.js. I've been trying to update my...
Read more >
TypeError: Path must be a string. Received undefined-babel.js
The issue has something to do with Node 6. Using Node 5.x instead will probably fix the issue for you, if that's an...
Read more >
Meteor 1.5.2 TypeError: Path must be a string. Received ...
When I do meteor build and deploy to server, I get this error when it reaches app.js. Hope someone can tell me how...
Read more >
TypeError: Path must be a string. Received undefined - ionic-v3
I just upgraded ionic to v3, first of all I uninstalled the previous version and then I installed the new one. I also...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found