Skip to content
This repository has been archived by the owner on Aug 25, 2022. It is now read-only.

win10 运行报错ReferenceError: root is not defined #98

Open
mengbin890815 opened this issue Dec 22, 2020 · 1 comment
Open

win10 运行报错ReferenceError: root is not defined #98

mengbin890815 opened this issue Dec 22, 2020 · 1 comment

Comments

@mengbin890815
Copy link

win10 运行 nosmoke -u R3CN70MKHYE -c D:\1_UHome\2_project\9_nosmoke\NoSmoke\demo\crawler.config.yml报错如下:
udid: R3CN70MKHYE
ReferenceError: root is not defined
at NSCrawlerConfig.loadDefault (D:\Programs\nodejs\node_global\node_modules\nosmoke\lib\crawler\config.js:40:3)
at Object. (D:\Programs\nodejs\node_global\node_modules\nosmoke\lib\crawler\index.js:13:15)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at module.exports (D:\Programs\nodejs\node_global\node_modules\nosmoke\lib\nosmoke.js:37:11)
at module.exports.next ()

lib\crawler\config.js:40:3 这个文件中

NSCrawlerConfig.prototype.loadDefault = function() {
let configFile = path.join(__dirname, '..', '..', 'demo', 'crawler.config.yml');
if (root.cmdArgs && root.cmdArgs.config) {
if (_.isExistedFile(root.cmdArgs.config)) {
configFile = root.cmdArgs.config;
} else {
console.log('invalid config file paths :' + root.cmdArgs.config);
process.exit();
}
}
root 没定义???

@macaca-bot
Copy link
Member

This is the translated issue:


Win10 run error ReferenceError: root is not defined

Win10 runs NOSMoke -u R3CN70MKHYE-C: \ 1_uhome \ 2_project \ 9_nosmoke \ NOSMOKE \ DEMO \ CRAWLER.CONFIG.YML error is as follows:
UDID: R3CN70MKHYEEEEEE
ReferenceError: root is not defined
AT NSCRAWLERCONFIG.LOADDEFAULT (D: \ Programs \ NodeJs \ Node_Global \ Node_Modules \ NOSMOKE \ LIB \ Crawler \ config.js: 40: 3)
At Object. (d: \ programs \ nodejs \ node_global \ node_modules \ NOSMOKE \ LIB \ CRAWLER \ Index.js: 13: 15)
At Module._Compile (INTERNAL / MODULES / CJS / Loader.js: 1063: 30)
At Object.Module._extensionsions..js (INTERNAL / MODULES / CJS / Loader.js: 1092: 10)
At Module.Load (Internal / Modules / CJS / Loader.js: 928: 32)
At Function.Module._Load (Internal / Modules / CJS / Loader.js: 769: 14)
At Module.Require (Internal / Modules / CJS / Loader.js: 952: 19)
At Require (INTERNAL / MODULES / CJS / Helpers.js: 88: 18)
At Module.Exports (D: \ Programs \ NodeJS \ Node_Global \ Node_Modules \ NOSMOKE \ LIB \ NOSMOKE.JS: 37: 11)
At Module.Exports.next ()

LIB \ crawler \ config.js: 40: 3 in this file

Nscrawlerconfig.prototype.loadDefault = function () {
Let configfile = path.join (__ dirname, '..', '..', 'demo', 'crawler.config.yml');
IF (Root.cmdargs && Root.cmdargs.config) {
IF (_.isexistedfile (root.cmdargs.config) {
CONFIGFILE = root.cmdargs.config;
} else {
Console.log ('Invalid Config File Paths:' + Root.cmdargs.config);
Process.exit ();
}
}
root is not defined? ? ?

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

No branches or pull requests

2 participants