ReferenceError: process is not defined
Opened this issue · 2 comments
pflannery commented
when running wtf-trace on a script that is referencing "process" I get an error message "process is not defined".
Is this is because the trace-runner.js isn't passing the process object to the vm context? https://github.com/google/tracing-framework/blob/master/bin/trace-runner.js#L81L87
dsummersl commented
I'm getting this too.
balupton commented
I'm getting this too:
app.js
#!/usr/bin/env node
if ( process.argv.length < 4 ) { // 0:node 1:app.js 2:in 3:out
throw new Error('Usage: node app.js input output1 [output2...]')
}
// ...
shell:
$ npm i -g tracing-framework
/Users/balupton/.nvm/versions/node/v5.8.0/bin/wtf-controller -> /Users/balupton/.nvm/versions/node/v5.8.0/lib/node_modules/tracing-framework/bin/controller.js
/Users/balupton/.nvm/versions/node/v5.8.0/bin/wtf-dump -> /Users/balupton/.nvm/versions/node/v5.8.0/lib/node_modules/tracing-framework/bin/dump.js
/Users/balupton/.nvm/versions/node/v5.8.0/bin/wtf-generate-webgl-app -> /Users/balupton/.nvm/versions/node/v5.8.0/lib/node_modules/tracing-framework/bin/generate-webgl-app.js
/Users/balupton/.nvm/versions/node/v5.8.0/bin/wtf-diff -> /Users/balupton/.nvm/versions/node/v5.8.0/lib/node_modules/tracing-framework/bin/diff.js
/Users/balupton/.nvm/versions/node/v5.8.0/bin/wtf-instrument -> /Users/balupton/.nvm/versions/node/v5.8.0/lib/node_modules/tracing-framework/bin/instrument.js
/Users/balupton/.nvm/versions/node/v5.8.0/bin/wtf-query -> /Users/balupton/.nvm/versions/node/v5.8.0/lib/node_modules/tracing-framework/bin/query.js
/Users/balupton/.nvm/versions/node/v5.8.0/bin/wtf-trace -> /Users/balupton/.nvm/versions/node/v5.8.0/lib/node_modules/tracing-framework/bin/trace-runner.js
/Users/balupton/.nvm/versions/node/v5.8.0/bin/wtf-save-trace -> /Users/balupton/.nvm/versions/node/v5.8.0/lib/node_modules/tracing-framework/bin/save-trace.js
/Users/balupton/.nvm/versions/node/v5.8.0/lib
└─┬ tracing-framework@2015.7.15-1
├─┬ falafel@0.1.4
│ └── esprima@1.0.0
├─┬ microtime@1.4.2
│ ├── bindings@1.2.1
│ └── nan@1.8.4
├── mkdirp@0.3.5
├─┬ optimist@0.3.5
│ └── wordwrap@0.0.3
├── string-hash@1.1.0
├─┬ temporary@0.0.7
│ └── package@1.0.1
└─┬ ws@0.4.25
├── commander@0.6.1
├── options@0.0.6
└── tinycolor@0.0.1
$ wtf-trace app.js 1 2 3
/Users/balupton/Projects/uni/node-stream/app.js:2
if ( process.argv.length < 4 ) { // 0:node 1:app.js 2:in 3:out
^
ReferenceError: process is not defined
at /Users/balupton/Projects/uni/node-stream/app.js:2:6
at Object.exports.runInContext (vm.js:44:17)
at Object.<anonymous> (/Users/balupton/.nvm/versions/node/v5.8.0/lib/node_modules/tracing-framework/bin/trace-runner.js:94:4)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Function.Module.runMain (module.js:447:10)
at startup (node.js:141:18)
at node.js:933:3