hanzi icon indicating copy to clipboard operation
hanzi copied to clipboard

I have trouble to initiate HanziJS. Required.

Open yancy9303 opened this issue 4 years ago • 4 comments

C:\Users\yangh>var hanzi = require("hanzi"); 'var' is not recognized as an internal or external command, operable program or batch file.

I successfully installed node and npm, but I am having trouble to initiate hanzi. How could I slove this problem? I am new to npm. It is a great package for language researcher. Thanks.

Yancy

yancy9303 avatar Oct 31 '19 20:10 yancy9303

Hi Yancy. You need to install node.js then first run

> node

Then run

var hanzi = require("hanzi");

zurawiki avatar Nov 02 '19 02:11 zurawiki

I installed note.js and npm. But it is still not work.

Yancy.

获取 Outlook for iOShttps://aka.ms/o0ukef


发件人: Roger Zurawicki [email protected] 发送时间: Friday, November 1, 2019 10:45:11 PM 收件人: nieldlr/hanzi [email protected] 抄送: yancy9303 [email protected]; Author [email protected] 主题: Re: [nieldlr/hanzi] I have trouble to initiate HanziJS. Required. (#59)

Hi Yancy. You need to install node.js then first run

node

Then run

var hanzi = require("hanzi");

― You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/nieldlr/hanzi/issues/59?email_source=notifications&email_token=ANUVSINSWWUW6T3GMSYS5BLQRTSTPA5CNFSM4JHRX3Q2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEC4SAFQ#issuecomment-549003286, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANUVSIOGJBCVKEJM63FC3N3QRTSTPANCNFSM4JHRX3QQ.

yancy9303 avatar Nov 02 '19 02:11 yancy9303

You need to run that code inside of the node program. From your error, it looks like you are running the code in a command prompt. First type node to run the node program, then try running your code.

zurawiki avatar Nov 04 '19 05:11 zurawiki

@yancy9303

  1. Install node
  2. Make a file myfile.js
  3. In myfile.js put:
var hanzi = require("hanzi");
hanzi.start()
...
  1. From command line enter > node myfile.js

benlieb avatar Mar 02 '20 04:03 benlieb