在节点 js 中使用 music21j,而不是在浏览器中
Using music21j in node js, not in browser
我正在尝试 运行 节点 js ( repo link , npm link ) 中的 music21j。
我得到ReferenceError: self is not defined
尝试简单地初始化 music21j 时:
const music21 = require('music21j');
const n = new music21.note.Note('F#');
这是否意味着无法 运行 在浏览器之外,或者我是否以某种方式初始化到错误的环境?
github 文档指出
...or use it in your javascript/typescript project
,因此我感到困惑。
来自 github 存储库:
At present it's not possible to run outside of the browser. :-( But we're working on removing certain JQuery patches that should make it easier to do. You may however need to use ES6-style imports.
我正在尝试 运行 节点 js ( repo link , npm link ) 中的 music21j。
我得到ReferenceError: self is not defined
尝试简单地初始化 music21j 时:
const music21 = require('music21j');
const n = new music21.note.Note('F#');
这是否意味着无法 运行 在浏览器之外,或者我是否以某种方式初始化到错误的环境?
github 文档指出
...or use it in your javascript/typescript project
,因此我感到困惑。
来自 github 存储库:
At present it's not possible to run outside of the browser. :-( But we're working on removing certain JQuery patches that should make it easier to do. You may however need to use ES6-style imports.