Home  >  Q&A  >  body text

javascript - I have a question, how do you install the development environment for packages cloned from github?

I encountered a problem of debugging JS on a mobile phone, and then found vconsole to display the log.

https://github.com/WechatFE/v...

I downloaded the zip package directly, then entered the directory and used npm to install development dependencies

npm install --save-dev 

All packages have been installed, and then run according to package.json

npm run dist

Then an error was reported.

The worst thing is that basically none of the packages I installed using this method can run successfully according to the documentation.

Either it prompts that something is missing, or it tells me that the command cannot be run and an error occurs. .

So I would like to ask, how do you all do it? ? ? ?

-----------------------Update line----------------------- ----

I don’t want to know why the instance of this package ran wrong. I want to ask how everyone installed the package?

Let me talk about my method first:

1) Download the package first

2) Enter the package, view the package.json file, and look for test case scripts and compilation scripts

3) Use npm install --save-dev to install development dependencies

4) Use npm run script to run the script

The reason why I ask is that I have encountered many problems. When running the script to compile, some prompts that there are few dependencies, but there is no error when installing the dependencies.

There are also test case errors, just like this time. Regarding this kind of problem, I have searched for related questions and articles myself, and read the readme

before each installation.

file, so I asked everyone how they did it, and I wanted to make sure I didn't overlook it or make something wrong all the time.

扔个三星炸死你扔个三星炸死你2568 days ago681

reply all(4)I'll reply

  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-07-05 10:46:54

    It seems that this library’s own UT has not been run. I guess it is not your problem. For example, this paragraph:

    var vcSwitch = document.querySelector('.vc-switch');
    
      var eventTouchstart = document.createEvent('Event');
      eventTouchstart.initEvent('touchstart', true, true);
      var point = { x: 10, y: 10 };
      eventTouchstart.touches = [{
        identifier: Math.random(),
        pageX: point.x,
        pageY: point.y,
        screenX: point.x,
        screenY: point.y,
        clientX: point.x,
        clientY: point.y
      }];
    vcSwitch.dispatchEvent(eventTouchstart);

    In the test/log.html file specified in this case, there is indeed no element declared as .vc-switch. Naturally, an error was reported.

    Of course I’m not familiar with this stuff, so asking the original author would be the best option

    reply
    0
  • ringa_lee

    ringa_lee2017-07-05 10:46:54

    please read README.md

    reply
    0
  • 淡淡烟草味

    淡淡烟草味2017-07-05 10:46:54

    Follow the steps in the readme. If it doesn’t work, check the wiki and issue of the project first. If there are no relevant questions, just file an issue yourself. It’s much better than asking blind questions here

    reply
    0
  • 三叔

    三叔2017-07-05 10:46:54

    The readme below is very clear, take a look at it yourself. Many times, companies want people with the ability to solve problems independently.

    You have to rely on yourself to solve this kind of problem. Training your ability to solve problems is essential to grow into a big front end

    https://github.com/WechatFE/v...

    reply
    0
  • Cancelreply