我尝试这个const csvFile = require("pathtocsv.csv")
但这给我一个错误:
pathtocsv.csv:18
return,100,physical,null,0,selected-pokemon,normal
^
SyntaxError: Unexpected token ,
at new Script (vm.js:79:7)
at createScript (vm.js:251:10)
at Object.runInThisContext (vm.js:303:10)
at Module._compile (internal/modules/cjs/loader.js:657:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
我尝试执行一些console.log来检查错误从何处开始,并以require开头。
我尝试修改我的csv,我用半列替换了逗号,但是什么也没发生,错误虽然不一样,但是是完全相同的错误类型,但是在另一行:
brick-break;100;physical;75;0;selected-pokemon;fighting
^^^^^