NAE 启项目的时候报Cannot find module 'child_process' 这是为什么?
发布于 2年前 作者 smilexu 732 次浏览

Error: Cannot find module ‘child_process’

at Function._resolveFile (/home/admin/cnae/git/cnode-app-engine/lib/sandbox.js:306:9)

at Function._loadFile (/home/admin/cnae/git/cnode-app-engine/lib/sandbox.js:160:30)

at [object Object].require (/home/admin/cnae/git/cnode-app-engine/lib/sandbox.js:185:17)

at require (/home/admin/cnae/git/cnode-app-engine/lib/sandbox.js:316:17)

at Object.<anonymous> (/home/admin/cnae/git/cnode-app-engine/dev/xuyong/node_modules/socket.io/lib/static.js:13:10)

at [object Object]._compileFile (/home/admin/cnae/git/cnode-app-engine/lib/sandbox.js:347:49)

at Object…js (/home/admin/cnae/git/cnode-app-engine/lib/sandbox.js:391:9)

at [object Object].load (/home/admin/cnae/git/cnode-app-engine/lib/sandbox.js:150:17)

at Function._loadFile (/home/admin/cnae/git/cnode-app-engine/lib/sandbox.js:176:10)

at [object Object].require (/home/admin/cnae/git/cnode-app-engine/lib/sandbox.js:185:17)

3 回复

是在执行到这句的时候报的 var io = require(‘socket.io’);

child_process模块在沙箱中被禁用了

那就是在nae里无法使用socket了?

回到顶部