dundalek / markmap

Visualize markdown documents as mindmaps
MIT License
1.7k stars 175 forks source link

error when installation #26

Closed shyandsy closed 5 years ago

shyandsy commented 5 years ago

when I use npm install command after git clone, there is some error message about the deprecated package browserslist.

I’m not familiar with nodejs, are there any solution?

D:\shyclouds\markmap (master -> origin) (markmap@0.6.0)
λ npm install
npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.

> deasync@0.1.14 install D:\shyclouds\markmap\node_modules\deasync
> node ./build.js

`win32-x64-node-10` exists; testing
Binary is fine; exiting

> parcel-bundler@1.11.0 postinstall D:\shyclouds\markmap\node_modules\parcel-bundler
> node -e "console.log('\u001b[35m\u001b[1mLove Parcel? You can now donate to our open collective:\u001b[22m\u001b[39m\n > \u001b[34mhttps://opencollective.com/parcel/donate\u001b[0m')"

Love Parcel? You can now donate to our open collective:
 > https://opencollective.com/parcel/donate
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

added 1107 packages from 756 contributors and audited 12131 packages in 47.66s
found 1 moderate severity vulnerability
  run `npm audit fix` to fix them, or `npm audit` for details

then i try to use 'npm audit fix'

λ npm audit fix
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

when I run the example js code, the error message shows below

λ node example.markdown.js
D:\shyclouds\markmap\node_modules\d3\d3.js:1935
    var xhr = {}, dispatch = d3.dispatch("beforesend", "progress", "load", "error"), headers = {}, request = new XMLHttpRequest(), responseType = null;
                                                                                                             ^

ReferenceError: XMLHttpRequest is not defined
    at d3_xhr (D:\shyclouds\markmap\node_modules\d3\d3.js:1935:110)
    at Object.text (D:\shyclouds\markmap\node_modules\d3\d3.js:1931:14)
    at Object.<anonymous> (D:\shyclouds\markmap\examples\browser\example.markdown.js:7:4)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
    at startup (internal/bootstrap/node.js:283:19)
dundalek commented 5 years ago

Hi, I think the problem is that it looks like you are trying to run an example for web browser in node. The examples in examples/browser are meant for the web browser, the examples in examples/node are for node.

shyandsy commented 5 years ago

hi

the error message occured when i install

look like the installation failed due to the deprecated package

发自我的 iPhone

在 2019年1月31日,06:16,Jakub Dundalek notifications@github.com 写道:

Hi, I think the problem is that it looks like you are trying to run an example for web browser in node. The examples in examples/browser are meant for the web browser, the examples in examples/node are for node.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

dundalek commented 5 years ago

During installation it is just a warning, which is not too important. The real issue is ReferenceError: XMLHttpRequest is not defined which indicates that you tried to run browser examples in node.js.

shyandsy commented 5 years ago

thanks u

I'm running npm start under browser folder, but there is error when I open mindmup

image

and the other example only show a root like this

image

dundalek commented 5 years ago

Try running npm start at the top of the project folder.

shyandsy commented 5 years ago

yeah i did that

On Thu, Jan 31, 2019 at 3:28 PM Jakub Dundalek notifications@github.com wrote:

To run the browser examples you need to run npm start, instructions are written in the readme.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dundalek/markmap/issues/26#issuecomment-459513116, or mute the thread https://github.com/notifications/unsubscribe-auth/AFBvoZd7FMNMwH7hbw3rNp62roiBsr30ks5vI2ANgaJpZM4aa32L .

-- Yang Shi 201-15 bridgeland dr south R3Y 0E7

dundalek commented 5 years ago

I see, you are right. A third party package broke it. I locked down the dependency versions, which fixes it.

Please try to pull the latest commit, then run npm install again and after that npm start should work again.

shyandsy commented 5 years ago

it works now

a start for you , thank u

dundalek commented 5 years ago

great, thanks :+1: