首页 文章

我如何在ubuntu中运行“node index.js”

提问于
浏览
0

这是在windows环境中创建的,如何将其运行到ubuntu环境中 .

stayinc/server$ node index.js 

util.js:538
  ctor.prototype = Object.create(superCtor.prototype, {
                                          ^
TypeError: Cannot read property 'prototype' of undefined
    at Object.exports.inherits (util.js:538:43)
    at Object. (/media/subhasis/3C92D33592D2F27E/LocalProject/stayinc/server/node_modules/mongodb/lib/gridfs-stream/download.js:46:6)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Object. (/media/subhasis/3C92D33592D2F27E/LocalProject/stayinc/server/node_modules/mongodb/lib/gridfs-stream/index.js:2:30)
    at Module._compile (module.js:449:26)

2 回答

  • 1

    在运行“node index.js”之前是否运行了以下命令?

    npm install
    
  • 0

    它必须是 node.js 过时版本的问题 .

    您可以通过输入来检查当前版本

    node -v
    

    我想它会输出类似 0.8 的东西,这很老了 .

相关问题