简体   繁体   English

在IBM i(以前称为iSeries或AS / 400)上运行Node.js程序时出错

[英]Error while running Node.js program on IBM i (previously known as iSeries or AS/400)

IBM i Version : V7R2M0

node installation path: /QOpenSys/QIBM/ProdData/Node/bin

node -v : v0.12.17

I've created a simple console.log('hello world') program, while running getting following error 我创建了一个简单的console.log('hello world')程序,同时遇到以下错误

$ cd /QOpenSys/QIBM/ProdData/Node/bin

$ node /home/anoop/index.js  

function (exports, require, module, __filename, __dirname) {         
yntaxError: Unexpected token  
ILLEGAL                                                               
 at exports.runInThisContext    
(vm.js:73:16)                                                       
at Module._compile    
(module.js:443:25)                                                           

at Object.Module._extensions..js (module.js:478:10)   
at Module.load (module.js:355:32)      
at Function.Module._load (module.js:310:12) 
at Function.Module.runMain (module.js:501:10)        
at startup (node.js:129:16)                      
at node.js:814:3 

It is related to CCSID of file. 与文件的CCSID有关。 You need to create file with 1208 CCSID or an ASCII codepage. 您需要使用1208 CCSID或ASCII代码页创建文件。 So file is created as follows 因此,文件创建如下

$ touch -C 1208 index.js $ touch -C 1208 index.js

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM