1、安装vue-router
C:UsersAdministrator.USER-0GUONPPBHK>npm install vue-router
npm WARN saveError ENOENT: no such file or directory, open 'C:UsersAdministrat
or.USER-0GUONPPBHKpackage.json'
npm WARN enoent ENOENT: no such file or directory, open 'C:UsersAdministrator.
USER-0GUONPPBHKpackage.json'
npm WARN Administrator.USER-0GUONPPBHK No description
npm WARN Administrator.USER-0GUONPPBHK No repository field.
npm WARN Administrator.USER-0GUONPPBHK No README data
npm WARN Administrator.USER-0GUONPPBHK No license field.
+ vue-router@3.0.1
added 1 package and removed 1 package in 1.997s
C:UsersAdministrator.USER-0GUONPPBHK>cnpm install vue-router
√ Installed 1 packages
√ Linked 0 latest versions
√ Run 0 scripts
√ All packages installed (1 packages installed from npm registry, used 488ms, s
peed 261.65kB/s, json 1(65.8kB), tarball 61.88kB)
2、克隆vue-router
C:UsersAdministrator.USER-0GUONPPBHK>cnpm install vue-router
√ Installed 1 packages
√ Linked 0 latest versions
√ Run 0 scripts
√ All packages installed (1 packages installed from npm registry, used 488ms, s
peed 261.65kB/s, json 1(65.8kB), tarball 61.88kB)
C:UsersAdministrator.USER-0GUONPPBHK>git clone https://github.com/vuejs/vue-ro
uter.git node_modules/vue-router
fatal: destination path 'node_modules/vue-router' already exists and is not an e
mpty directory.
C:UsersAdministrator.USER-0GUONPPBHK>git clone https://github.com/vuejs/vue-ro
uter.git node_module/vue-router
Cloning into 'node_module/vue-router'...
remote: Counting objects: 10589, done.
remote: Compressing objects: 100% (52/52), done.
rRemote: Total 10589 (delta 187), reused 238 (delta 187), pack-reused 10349eceiv
Receiving objects: 100% (10589/10589), 5.93 MiB | 170.00 KiB/s, done.
Resolving deltas: 100% (6479/6479), done.
Checking connectivity... done.
3、切换路径
C:UsersAdministrator.USER-0GUONPPBHK>cd node_module/vue-router
4、安装vue-router
C:UsersAdministrator.USER-0GUONPPBHK
ode_modulevue-router>npm install
> chromedriver@2.35.0 install C:UsersAdministrator.USER-0GUONPPBHK
ode_module
vue-router
ode_moduleschromedriver
> node install.js
Downloading https://chromedriver.storage.googleapis.com/2.35/chromedriver_win32.
zip
Saving to C:UsersADMINI~1.USEAppDataLocalTempchromedriverchromedriver_win
32.zip
Received 781K...
Received 1568K...
Received 2352K...
Received 3136K...
Received 3255K total.
Extracting zip contents
Copying to target path C:UsersAdministrator.USER-0GUONPPBHK
ode_modulevue-ro
uter
ode_moduleschromedriverlibchromedriver
Done. ChromeDriver binary available at C:UsersAdministrator.USER-0GUONPPBHK
o
de_modulevue-router
ode_moduleschromedriverlibchromedriverchromedriver.exe
> phantomjs-prebuilt@2.1.16 install C:UsersAdministrator.USER-0GUONPPBHK
ode_
modulevue-router
ode_modulesphantomjs-prebuilt
> node install.js
PhantomJS not found on PATH
Downloading https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantom
js-2.1.1-windows.zip
Saving to C:UsersADMINI~1.USEAppDataLocalTempphantomjsphantomjs-2.1.1-win
dows.zip
Receiving...
[=======================================-] 98%
Received 17767K total.
Extracting zip contents
Removing C:UsersAdministrator.USER-0GUONPPBHK
ode_modulevue-router
ode_modu
lesphantomjs-prebuiltlibphantom
Copying extracted folder C:UsersADMINI~1.USEAppDataLocalTempphantomjsphan
tomjs-2.1.1-windows.zip-extract-1521888689645phantomjs-2.1.1-windows -> C:User
sAdministrator.USER-0GUONPPBHK
ode_modulevue-router
ode_modulesphantomjs-pr
ebuiltlibphantom
Writing location.js file
Done. Phantomjs binary available at C:UsersAdministrator.USER-0GUONPPBHK
ode_
modulevue-router
ode_modulesphantomjs-prebuiltlibphantominphantomjs.exe
> uglifyjs-webpack-plugin@0.4.6 postinstall C:UsersAdministrator.USER-0GUONPPB
HK
ode_modulevue-router
ode_modulesuglifyjs-webpack-plugin
> node lib/post_install.js
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modulesfse
vents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}
)
added 1025 packages in 145.872s
5、运行构建
C:UsersAdministrator.USER-0GUONPPBHK
ode_modulevue-router>npm run build
> vue-router@3.0.1 build C:UsersAdministrator.USER-0GUONPPBHK
ode_modulevue-
router
> node build/build.js
Circular dependency: srcinstall.js -> srccomponentslink.js -> srcinstall.js
Circular dependency: srcutilpush-state.js -> srcutilscroll.js -> srcutilpu
sh-state.js
distvue-router.js 65.77kb
Circular dependency: srcinstall.js -> srccomponentslink.js -> srcinstall.js
Circular dependency: srcutilpush-state.js -> srcutilscroll.js -> srcutilpu
sh-state.js
distvue-router.min.js 23.47kb (gzipped: 8.35kb)
Circular dependency: srcinstall.js -> srccomponentslink.js -> srcinstall.js
Circular dependency: srcutilpush-state.js -> srcutilscroll.js -> srcutilpu
sh-state.js
distvue-router.common.js 66.12kb
Circular dependency: srcinstall.js -> srccomponentslink.js -> srcinstall.js
Circular dependency: srcutilpush-state.js -> srcutilscroll.js -> srcutilpu
sh-state.js
distvue-router.esm.js 66.10kb
C:UsersAdministrator.USER-0GUONPPBHK
ode_modulevue-router>