corenova / yang-js

YANG parser and composer
Apache License 2.0
56 stars 18 forks source link

Not working on Windows platform? #127

Open fredgan opened 3 years ago

fredgan commented 3 years ago

Hi Peter @sekur ,

I try to npm install and npm run build:web, it reported an error said the dependency lib fsevents is only working for MacOS system. So Does it mean that I can only use MacOS for developing yang-js? Thanks

$ npm install

> yang-js@0.24.31 prepare D:\Project\third-party\yang-js
> yarn prepare:clean && yarn prepare:src

yarn run v1.22.5
$ yarn clean -s && mkdir -p dist
$ rimraf dist/* lib/* -s
Done in 1.71s.
yarn run v1.22.5
$ coffee -o lib -c src
Done in 1.77s.
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.1 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

up to date in 7.04s

g00507579@LancePC MINGW64 /d/Project/third-party/yang-js (master)
$ npm run build:web
npm ERR! missing script: build:web

npm ERR! A complete log of this run can be found in:
sekur commented 3 years ago

Sorry for the late reply on this... No, the fsevents shouldn't be a preprequisite, it's just a warning.

The real culprit here is that I have outdated docs and the build:web target doesn't exist... the equivalent is to do yarn prepublishOnly or npm run prepublishOnly

sekur commented 3 years ago

In any case, I also have it such that by default, you can find it in dist/yang.js as part of the npm package. You can also use it via require('yang-js/dist/yang')