javascript - I have a question, how do you install the development environment for packages cloned from github?
扔个三星炸死你
扔个三星炸死你 2017-07-05 10:44:54
0
4
742

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.

扔个三星炸死你
扔个三星炸死你

reply all (4)
曾经蜡笔没有小新

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 thetest/log.htmlfile 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

    ringa_lee

    please read README.md

      淡淡烟草味

      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

        三叔

        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...

          Latest Downloads
          More>
          Web Effects
          Website Source Code
          Website Materials
          Front End Template
          About us Disclaimer Sitemap
          php.cn:Public welfare online PHP training,Help PHP learners grow quickly!