NodeOS / NodeOS

Lightweight operating system using Node.js as userspace

Home Page:http://node-os.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

start script file has error.

Stanlyhalo opened this issue · comments

This is the default start script file provided by NodeOS:

#!/usr/bin/env node

/**
 * NodeOS
 *
 * @copyright 2013-2017 Jacob Groundwater, Jesús Leganés-Combarro 'piranna'
 *  and other contributors
 *
 * @license MIT
 */

const spawn = require('child_process').spawn;

const prepareCommandLine = require('..')


const {command, argv, cwd} = prepareCommandLine(process.argv.slice(2))


// Exec NodeOS
spawn(command, argv, {stdio: 'inherit', cwd})
.on('error', console.trace.bind(console))
.on('exit', function(code, signal)
{
  process.exit(code || signal)
})

And when I run "npm start" in Ubuntu WSL it displays this error:

const {command, argv, cwd} = prepareCommandLine(process.argv.slice(2))
                             ^

TypeError: prepareCommandLine is not a function

I have also tried "bash npm start", but it just displays this error:

/home/stanlyhalo/.nvm/versions/node/v12.18.0/bin/npm: npm: line 2: syntax error near unexpected token `;'
/home/stanlyhalo/.nvm/versions/node/v12.18.0/bin/npm: npm: line 2: `;(function () { // wrapper in case we're in module_context mode'

What I'm trying to do in the end is run NodeOS in qemu.

Also I can't installed the module "`nodeos-usersf'" and this some of the error (that I believe are major keys):

gyp ERR! stack Error: `make` failed with exit code: 2
src-errno@0.2.0 install: `node-gyp rebuild`
Failed at the src-errno@0.2.0 install script.

There are also some hints to as why it errored earlier in the error notice, so here they are:

../src/errno.cc: At global scope:
../src/errno.cc:25:11: error: variable or field ‘init’ declared void
   25 | void init(Handle<Object> exports) {
      |           ^~~~~~
../src/errno.cc:25:11: error: ‘Handle’ was not declared in this scope
../src/errno.cc:25:24: error: expected primary-expression before ‘>’ token
   25 | void init(Handle<Object> exports) {
      |                        ^
../src/errno.cc:25:26: error: ‘exports’ was not declared in this scope
   25 | void init(Handle<Object> exports) {
      |                          ^~~~~~~
In file included from ../src/errno.cc:6:
../src/errno.cc:32:22: error: ‘init’ was not declared in this scope; did you mean ‘int’?
   32 | NODE_MODULE(binding, init)
      |                      ^~~~
/home/stanlyhalo/.cache/node-gyp/12.18.0/include/node/node.h:608:36: note: in definition of macro ‘NODE_MODULE_X’
  608 |       (node::addon_register_func) (regfunc),                          \
      |                                    ^~~~~~~
../src/errno.cc:32:1: note: in expansion of macro ‘NODE_MODULE’
   32 | NODE_MODULE(binding, init)
      | ^~~~~~~~~~~