Skip to content
This repository has been archived by the owner on Aug 24, 2023. It is now read-only.

Docs could be better #17

Open
NaturelLee opened this issue Feb 7, 2021 · 1 comment
Open

Docs could be better #17

NaturelLee opened this issue Feb 7, 2021 · 1 comment

Comments

@NaturelLee
Copy link

NaturelLee commented Feb 7, 2021

in ubuntu

Installation needed

  1. ssvmup
npm i -g ssvmup
  1. wasm-opt
npm i -g wasm-opt
  1. node-pre-gyp
npm i -g  node-pre-gyp

Errors

// this is the file ssvm_nodejs_starter_lib.js generated by ssvmup build

let vm;

/**
* @param {string} s
* @returns {string}
*/
module.exports.say = function(s) {
    if (typeof s === 'object') s = JSON.stringify(s);
    return vm.RunString('say', s);
};

const path = require('path').join(__dirname, 'ssvm_nodejs_starter_lib_bg.wasm');
const ssvm = require('ssvm'); 
vm = new ssvm.VM(path, { args:process.argv, env:process.env, preopens:{'/': __dirname} });

ssvm is a node module? but when installed globally, then run node node/app.js

Error: Cannot find module 'ssvm'

I tried several times, it still failed.

If ssvm is only available from source code/docker. The node module ssvm should be deprecated/deleted.

It's not easy to use it for newbies

@hydai
Copy link
Member

hydai commented Feb 7, 2021

Hi,
Our document in this repo doesn't contain the manually setup guide. This will be fixed later.
If you want to setup the environment, we have a blog to describe this: https://www.secondstate.io/articles/setup-rust-nodejs/

ssvm is a node module? but when installed globally, then run node node/app.js

Yes, ssvm is a node module, you can install it with npm install ssvm.
And the repository is here: https://github.com/second-state/ssvm-napi
The npm package is here: https://www.npmjs.com/package/ssvm

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants