vue spa project build

Vue+SpringBoot项目部署:解决SPA路由白屏与Nginx配置全攻略 单页应用(SPA)是现代前端开发的主流模式,其核心原理是通过前端路由动态管理视图,而非每次请求都从服务器获取新页面。这种架构在提升用户体验的同时,也带来了部署上的挑战:当SPA部署到Nginx等静态文件服务器时,访问非根路径(如/about)会因服务器找不到对应的物理文件而返回404,导致应用白屏。其技术价值在于实现了前后端彻底解耦,前端独立部署,后端专注API。典型的应用场景是Vue、React等框架构建的企业级后台管理系统或内容型网站。要解决此问题,关键在于配置Nginx的`try_files`指令,将 阅读详情
在上文中已经讲述 mac 安装 npm . 下面 利用npm 来构建vue但页面项目 
首先安装vue
# 最新稳定版本
$ npm install vue
# 最新稳定 CSP 兼容版本
$ npm install vue@csp
我选择的是 兼容版本 原因如下

有些环境,如 Google Chrome Apps,强制应用内容安全策略 (CSP) ,不能使用 new Function() 对表达式求值。这时可以用 CSP 兼容版本。

其次,依次运行:
# 全局安装 vue-cli
$ npm install -g vue-cli
# 创建一个基于 "webpack" 模板的新项目
$ vue init webpack my-project
# 安装依赖,走你
$ cd my-project
$ npm install
$ npm run dev
对terminal做下解释 

https://vuejs-templates.github.io/webpack :项目使用文档

? Project name vue-cli
? Project description vue build demo
? Author ly
? Use ESLint to lint your code? Yes 代码统一规范,方便迁移
? Pick an ESLint preset Standard
? Setup unit tests with Karma + Mocha? Yes karma 单元测试
? Setup e2e tests with Nightwatch? Yes
Terminal:

Last login: Sat Jul 30 20:13:33 on ttys000
localhost:~ liyang$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"  
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
==> The following directories will be made group writable:
/usr/local/.
/usr/local/bin
==> The following directories will have their owner set to liyang:
/usr/local/.
/usr/local/bin
==> The following directories will have their group set to admin:
/usr/local/.
/usr/local/bin

Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/. /usr/local/bin
Password:
==> /usr/bin/sudo /usr/sbin/chown liyang /usr/local/. /usr/local/bin
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/. /usr/local/bin
==> /usr/bin/sudo /bin/mkdir -p /Users/liyang/Library/Caches/Homebrew
==> /usr/bin/sudo /bin/chmod g+rwx /Users/liyang/Library/Caches/Homebrew
==> /usr/bin/sudo /usr/sbin/chown liyang /Users/liyang/Library/Caches/Homebrew
==> Downloading and installing Homebrew...
remote: Counting objects: 531, done.
remote: Compressing objects: 100% (471/471), done.
remote: Total 531 (delta 31), reused 318 (delta 29), pack-reused 0
Receiving objects: 100% (531/531), 793.28 KiB | 133.00 KiB/s, done.
Resolving deltas: 100% (31/31), done.
From https://github.com/Homebrew/brew
 * [new branch]      master     -> origin/master
HEAD is now at 1244aa6 utils: fix option handling in 'odisabled'
==> Tapping homebrew/core
Cloning into '/usr/local/Library/Taps/homebrew/homebrew-core'...
remote: Counting objects: 3716, done.
remote: Compressing objects: 100% (3603/3603), done.
remote: Total 3716 (delta 15), reused 1936 (delta 4), pack-reused 0
Receiving objects: 100% (3716/3716), 2.88 MiB | 167.00 KiB/s, done.
Resolving deltas: 100% (15/15), done.
Checking connectivity... done.
Tapped 3594 formulae (3,742 files, 8.9M)
==> Installation successful!
==> Next steps
Run `brew help` to get started
Further documentation: https://git.io/brew-docs
==> Homebrew has enabled anonymous aggregate user behaviour analytics
Read the analytics documentation (and how to opt-out) here:
  https://git.io/brew-analytics
localhost:~ liyang$ brew install node
==> Downloading https://homebrew.bintray.com/bottles/node-6.3.1.el_capitan.bottl
######################################################################## 100.0%
==> Pouring node-6.3.1.el_capitan.bottle.tar.gz
==> Caveats
Please note by default only English locale support is provided. If you need
full locale support you should either rebuild with full icu:
  `brew reinstall node --with-full-icu`
or add full icu data at runtime following:
  https://github.com/nodejs/node/wiki/Intl#using-and-customizing-the-small-icu-build

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Summary
��  /usr/local/Cellar/node/6.3.1: 3,829 files, 39.8M
localhost:~ liyang$ npm -v
3.10.3
localhost:~ liyang$ clear

localhost:~ liyang$ npm install vue@csp
/Users/liyang
└─┬ vue@1.0.26-csp 
  └─┬ envify@3.4.1 
    ├─┬ jstransform@11.0.3 
    │ ├── base62@1.1.1 
    │ ├─┬ commoner@0.10.4 
    │ │ ├─┬ commander@2.9.0 
    │ │ │ └── graceful-readlink@1.0.1 
    │ │ ├─┬ detective@4.3.1 
    │ │ │ ├── acorn@1.2.2 
    │ │ │ └── defined@1.0.0 
    │ │ ├─┬ glob@5.0.15 
    │ │ │ ├─┬ inflight@1.0.5 
    │ │ │ │ └── wrappy@1.0.2 
    │ │ │ ├── inherits@2.0.1 
    │ │ │ ├─┬ minimatch@3.0.2 
    │ │ │ │ └─┬ brace-expansion@1.1.6 
    │ │ │ │   ├── balanced-match@0.4.2 
    │ │ │ │   └── concat-map@0.0.1 
    │ │ │ ├── once@1.3.3 
    │ │ │ └── path-is-absolute@1.0.0 
    │ │ ├── graceful-fs@4.1.5 
    │ │ ├── iconv-lite@0.4.13 
    │ │ ├─┬ mkdirp@0.5.1 
    │ │ │ └── minimist@0.0.8 
    │ │ ├── private@0.1.6 
    │ │ ├── q@1.4.1 
    │ │ └─┬ recast@0.10.43 
    │ │   ├── ast-types@0.8.15 
    │ │   ├── esprima-fb@15001.1001.0-dev-harmony-fb 
    │ │   └── source-map@0.5.6 
    │ ├── esprima-fb@15001.1.0-dev-harmony-fb 
    │ ├── object-assign@2.1.1 
    │ └─┬ source-map@0.4.4 
    │   └── amdefine@1.0.0 
    └── through@2.3.8 

npm WARN enoent ENOENT: no such file or directory, open '/Users/liyang/package.json'
npm WARN liyang No description
npm WARN liyang No repository field.
npm WARN liyang No README data
npm WARN liyang No license field.
localhost:~ liyang$ npm install -g vue-cli
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
/usr/local/bin/vue -> /usr/local/lib/node_modules/vue-cli/bin/vue
/usr/local/lib
└─┬ vue-cli@2.1.1 
  ├─┬ async@2.0.1 
  │ └── lodash@4.14.1 
  ├─┬ chalk@1.1.3 
  │ ├── ansi-styles@2.2.1 
  │ ├── escape-string-regexp@1.0.5 
  │ ├── has-ansi@2.0.0 
  │ ├── strip-ansi@3.0.1 
  │ └── supports-color@2.0.0 
  ├─┬ commander@2.9.0 
  │ └── graceful-readlink@1.0.1 
  ├─┬ consolidate@0.14.1 
  │ └── bluebird@3.4.1 
  ├─┬ download-git-repo@0.1.2 
  │ ├─┬ download@4.4.3 
  │ │ ├─┬ caw@1.2.0 
  │ │ │ ├─┬ get-proxy@1.1.0 
  │ │ │ │ └─┬ rc@1.1.6 
  │ │ │ │   ├── deep-extend@0.4.1 
  │ │ │ │   ├── ini@1.3.4 
  │ │ │ │   └── strip-json-comments@1.0.4 
  │ │ │ ├── is-obj@1.0.1 
  │ │ │ └── object-assign@3.0.0 
  │ │ ├─┬ concat-stream@1.5.1 
  │ │ │ ├── readable-stream@2.0.6 
  │ │ │ └── typedarray@0.0.6 
  │ │ ├─┬ each-async@1.1.1 
  │ │ │ ├── onetime@1.1.0 
  │ │ │ └── set-immediate-shim@1.0.1 
  │ │ ├─┬ filenamify@1.2.1 
  │ │ │ ├── filename-reserved-regex@1.0.0 
  │ │ │ ├── strip-outer@1.0.0 
  │ │ │ └── trim-repeated@1.0.0 
  │ │ ├─┬ got@5.6.0 
  │ │ │ ├─┬ create-error-class@3.0.2 
  │ │ │ │ └── capture-stack-trace@1.0.0 
  │ │ │ ├── duplexer2@0.1.4 
  │ │ │ ├── is-plain-obj@1.1.0 
  │ │ │ ├── is-redirect@1.0.0 
  │ │ │ ├── is-retry-allowed@1.1.0 
  │ │ │ ├── is-stream@1.1.0 
  │ │ │ ├── lowercase-keys@1.0.0 
  │ │ │ ├── node-status-codes@1.0.0 
  │ │ │ ├─┬ parse-json@2.2.0 
  │ │ │ │ └─┬ error-ex@1.3.0 
  │ │ │ │   └── is-arrayish@0.2.1 
  │ │ │ ├── timed-out@2.0.0 
  │ │ │ ├── unzip-response@1.0.0 
  │ │ │ └─┬ url-parse-lax@1.0.0 
  │ │ │   └── prepend-http@1.0.4 
  │ │ ├─┬ gulp-decompress@1.2.0 
  │ │ │ ├─┬ archive-type@3.2.0 
  │ │ │ │ └── file-type@3.8.0 
  │ │ │ ├─┬ decompress@3.0.0 
  │ │ │ │ ├─┬ buffer-to-vinyl@1.1.0 
  │ │ │ │ │ └── uuid@2.0.2 
  │ │ │ │ ├─┬ decompress-tar@3.1.0 
  │ │ │ │ │ ├── is-tar@1.0.0 
  │ │ │ │ │ ├── object-assign@2.1.1 
  │ │ │ │ │ ├─┬ strip-dirs@1.1.1 
  │ │ │ │ │ │ ├─┬ is-absolute@0.1.7 
  │ │ │ │ │ │ │ └── is-relative@0.1.3 
  │ │ │ │ │ │ ├── is-natural-number@2.1.1 
  │ │ │ │ │ │ └── sum-up@1.0.3 
  │ │ │ │ │ ├─┬ tar-stream@1.5.2 
  │ │ │ │ │ │ └── end-of-stream@1.1.0 
  │ │ │ │ │ └─┬ vinyl@0.4.6 
  │ │ │ │ │   └── clone@0.2.0 
  │ │ │ │ ├─┬ decompress-tarbz2@3.1.0 
  │ │ │ │ │ ├── is-bzip2@1.0.0 
  │ │ │ │ │ ├── object-assign@2.1.1 
  │ │ │ │ │ ├─┬ seek-bzip@1.0.5 
  │ │ │ │ │ │ └── commander@2.8.1 
  │ │ │ │ │ └─┬ vinyl@0.4.6 
  │ │ │ │ │   └── clone@0.2.0 
  │ │ │ │ ├─┬ decompress-targz@3.1.0 
  │ │ │ │ │ ├── is-gzip@1.0.0 
  │ │ │ │ │ ├── object-assign@2.1.1 
  │ │ │ │ │ └─┬ vinyl@0.4.6 
  │ │ │ │ │   └── clone@0.2.0 
  │ │ │ │ ├─┬ decompress-unzip@3.4.0 
  │ │ │ │ │ ├── is-zip@1.0.0 
  │ │ │ │ │ ├─┬ through2@2.0.1 
  │ │ │ │ │ │ └── readable-stream@2.0.6 
  │ │ │ │ │ └─┬ yauzl@2.6.0 
  │ │ │ │ │   ├── buffer-crc32@0.2.5 
  │ │ │ │ │   └─┬ fd-slicer@1.0.1 
  │ │ │ │ │     └── pend@1.2.0 
  │ │ │ │ └── vinyl-assign@1.2.1 
  │ │ │ └─┬ gulp-util@3.0.7 
  │ │ │   ├── array-differ@1.0.0 
  │ │ │   ├── array-uniq@1.0.3 
  │ │ │   ├── beeper@1.1.0 
  │ │ │   ├─┬ dateformat@1.0.12 
  │ │ │   │ ├── get-stdin@4.0.1 
  │ │ │   │ └─┬ meow@3.7.0 
  │ │ │   │   ├─┬ camelcase-keys@2.1.0 
  │ │ │   │   │ └── camelcase@2.1.1 
  │ │ │   │   ├─┬ loud-rejection@1.6.0 
  │ │ │   │   │ ├─┬ currently-unhandled@0.4.1 
  │ │ │   │   │ │ └── array-find-index@1.0.1 
  │ │ │   │   │ └── signal-exit@3.0.0 
  │ │ │   │   ├── map-obj@1.0.1 
  │ │ │   │   ├─┬ normalize-package-data@2.3.5 
  │ │ │   │   │ ├── hosted-git-info@2.1.5 
  │ │ │   │   │ ├─┬ is-builtin-module@1.0.0 
  │ │ │   │   │ │ └── builtin-modules@1.1.1 
  │ │ │   │   │ └─┬ validate-npm-package-license@3.0.1 
  │ │ │   │   │   ├─┬ spdx-correct@1.0.2 
  │ │ │   │   │   │ └── spdx-license-ids@1.2.2 
  │ │ │   │   │   └─┬ spdx-expression-parse@1.0.2 
  │ │ │   │   │     └── spdx-exceptions@1.0.5 
  │ │ │   │   ├─┬ read-pkg-up@1.0.1 
  │ │ │   │   │ ├─┬ find-up@1.1.2 
  │ │ │   │   │ │ └── path-exists@2.1.0 
  │ │ │   │   │ └─┬ read-pkg@1.1.0 
  │ │ │   │   │   ├─┬ load-json-file@1.1.0 
  │ │ │   │   │   │ └── pify@2.3.0 
  │ │ │   │   │   └── path-type@1.1.0 
  │ │ │   │   ├─┬ redent@1.0.0 
  │ │ │   │   │ ├─┬ indent-string@2.1.0 
  │ │ │   │   │ │ └─┬ repeating@2.0.1 
  │ │ │   │   │ │   └── is-finite@1.0.1 
  │ │ │   │   │ └── strip-indent@1.0.1 
  │ │ │   │   └── trim-newlines@1.0.0 
  │ │ │   ├─┬ fancy-log@1.2.0 
  │ │ │   │ └── time-stamp@1.0.1 
  │ │ │   ├─┬ gulplog@1.0.0 
  │ │ │   │ └── glogg@1.0.0 
  │ │ │   ├─┬ has-gulplog@0.1.0 
  │ │ │   │ └── sparkles@1.0.0 
  │ │ │   ├── lodash._reescape@3.0.0 
  │ │ │   ├── lodash._reevaluate@3.0.0 
  │ │ │   ├── lodash._reinterpolate@3.0.0 
  │ │ │   ├─┬ lodash.template@3.6.2 
  │ │ │   │ ├── lodash._basecopy@3.0.1 
  │ │ │   │ ├── lodash._basetostring@3.0.1 
  │ │ │   │ ├── lodash._basevalues@3.0.0 
  │ │ │   │ ├── lodash._isiterateecall@3.0.9 
  │ │ │   │ ├─┬ lodash.escape@3.2.0 
  │ │ │   │ │ └── lodash._root@3.0.1 
  │ │ │   │ ├─┬ lodash.keys@3.1.2 
  │ │ │   │ │ ├── lodash._getnative@3.9.1 
  │ │ │   │ │ ├── lodash.isarguments@3.0.9 
  │ │ │   │ │ └── lodash.isarray@3.0.4 
  │ │ │   │ ├── lodash.restparam@3.6.1 
  │ │ │   │ └── lodash.templatesettings@3.1.1 
  │ │ │   ├── minimist@1.2.0 
  │ │ │   ├─┬ multipipe@0.1.2 
  │ │ │   │ └─┬ duplexer2@0.0.2 
  │ │ │   │   └─┬ readable-stream@1.1.14 
  │ │ │   │     └── isarray@0.0.1 
  │ │ │   ├── object-assign@3.0.0 
  │ │ │   ├─┬ through2@2.0.1 
  │ │ │   │ └── readable-stream@2.0.6 
  │ │ │   └── vinyl@0.5.3 
  │ │ ├── gulp-rename@1.2.2 
  │ │ ├── is-url@1.2.2 
  │ │ ├── read-all-stream@3.1.0 
  │ │ ├─┬ readable-stream@2.1.4 
  │ │ │ ├── buffer-shims@1.0.0 
  │ │ │ ├── core-util-is@1.0.2 
  │ │ │ ├── isarray@1.0.0 
  │ │ │ ├── process-nextick-args@1.0.7 
  │ │ │ ├── string_decoder@0.10.31 
  │ │ │ └── util-deprecate@1.0.2 
  │ │ ├── stream-combiner2@1.1.1 
  │ │ ├─┬ vinyl@1.2.0 
  │ │ │ ├── clone@1.0.2 
  │ │ │ ├── clone-stats@0.0.1 
  │ │ │ └── replace-ext@0.0.1 
  │ │ └─┬ vinyl-fs@2.4.3 
  │ │   ├─┬ duplexify@3.4.5 
  │ │   │ ├── end-of-stream@1.0.0 
  │ │   │ └── stream-shift@1.0.0 
  │ │   ├─┬ glob-stream@5.3.2 
  │ │   │ ├── glob@5.0.15 
  │ │   │ ├─┬ glob-parent@2.0.0 
  │ │   │ │ └── is-glob@2.0.1 
  │ │   │ ├─┬ micromatch@2.3.11 
  │ │   │ │ ├─┬ arr-diff@2.0.0 
  │ │   │ │ │ └── arr-flatten@1.0.1 
  │ │   │ │ ├── array-unique@0.2.1 
  │ │   │ │ ├─┬ braces@1.8.5 
  │ │   │ │ │ ├─┬ expand-range@1.8.2 
  │ │   │ │ │ │ └─┬ fill-range@2.2.3 
  │ │   │ │ │ │   ├── is-number@2.1.0 
  │ │   │ │ │ │   ├── isobject@2.1.0 
  │ │   │ │ │ │   └── randomatic@1.1.5 
  │ │   │ │ │ ├── preserve@0.2.0 
  │ │   │ │ │ └── repeat-element@1.1.2 
  │ │   │ │ ├─┬ expand-brackets@0.1.5 
  │ │   │ │ │ └── is-posix-bracket@0.1.1 
  │ │   │ │ ├── extglob@0.3.2 
  │ │   │ │ ├── filename-regex@2.0.0 
  │ │   │ │ ├── is-extglob@1.0.0 
  │ │   │ │ ├─┬ kind-of@3.0.4 
  │ │   │ │ │ └── is-buffer@1.1.3 
  │ │   │ │ ├── normalize-path@2.0.1 
  │ │   │ │ ├─┬ object.omit@2.0.0 
  │ │   │ │ │ └─┬ for-own@0.1.4 
  │ │   │ │ │   └── for-in@0.1.5 
  │ │   │ │ ├─┬ parse-glob@3.0.4 
  │ │   │ │ │ ├── glob-base@0.3.0 
  │ │   │ │ │ └── is-dotfile@1.0.2 
  │ │   │ │ └─┬ regex-cache@0.4.3 
  │ │   │ │   ├── is-equal-shallow@0.1.3 
  │ │   │ │   └── is-primitive@2.0.0 
  │ │   │ ├── ordered-read-streams@0.3.0 
  │ │   │ ├─┬ through2@0.6.5 
  │ │   │ │ └─┬ readable-stream@1.0.34 
  │ │   │ │   └── isarray@0.0.1 
  │ │   │ ├── to-absolute-glob@0.1.1 
  │ │   │ └─┬ unique-stream@2.2.1 
  │ │   │   └─┬ json-stable-stringify@1.0.1 
  │ │   │     └── jsonify@0.0.0 
  │ │   ├── graceful-fs@4.1.5 
  │ │   ├─┬ gulp-sourcemaps@1.6.0 
  │ │   │ ├── convert-source-map@1.3.0 
  │ │   │ └─┬ through2@2.0.1 
  │ │   │   └── readable-stream@2.0.6 
  │ │   ├── is-valid-glob@0.3.0 
  │ │   ├── lazystream@1.0.0 
  │ │   ├── lodash.isequal@4.3.0 
  │ │   ├── merge-stream@1.0.0 
  │ │   ├── strip-bom@2.0.0 
  │ │   ├─┬ strip-bom-stream@1.0.0 
  │ │   │ └── first-chunk-stream@1.0.0 
  │ │   ├─┬ through2@2.0.1 
  │ │   │ └── readable-stream@2.0.6 
  │ │   ├─┬ through2-filter@2.0.0 
  │ │   │ └─┬ through2@2.0.1 
  │ │   │   └── readable-stream@2.0.6 
  │ │   └── vali-date@1.0.0 
  │ └── git-clone@0.1.0 
  ├─┬ handlebars@4.0.5 
  │ ├── async@1.5.2 
  │ ├─┬ optimist@0.6.1 
  │ │ ├── minimist@0.0.10 
  │ │ └── wordwrap@0.0.3 
  │ ├─┬ source-map@0.4.4 
  │ │ └── amdefine@1.0.0 
  │ └─┬ uglify-js@2.7.0 
  │   ├── async@0.2.10 
  │   ├── source-map@0.5.6 
  │   ├── uglify-to-browserify@1.0.2 
  │   └─┬ yargs@3.10.0 
  │     ├── camelcase@1.2.1 
  │     ├─┬ cliui@2.1.0 
  │     │ ├─┬ center-align@0.1.3 
  │     │ │ ├─┬ align-text@0.1.4 
  │     │ │ │ ├── longest@1.0.1 
  │     │ │ │ └── repeat-string@1.5.4 
  │     │ │ └── lazy-cache@1.0.4 
  │     │ ├── right-align@0.1.3 
  │     │ └── wordwrap@0.0.2 
  │     ├── decamelize@1.2.0 
  │     └── window-size@0.1.0 
  ├─┬ inquirer@0.12.0 
  │ ├── ansi-escapes@1.4.0 
  │ ├── ansi-regex@2.0.0 
  │ ├─┬ cli-cursor@1.0.2 
  │ │ └─┬ restore-cursor@1.0.1 
  │ │   └── exit-hook@1.1.1 
  │ ├── cli-width@2.1.0 
  │ ├── figures@1.7.0 
  │ ├─┬ readline2@1.0.1 
  │ │ ├─┬ code-point-at@1.0.0 
  │ │ │ └── number-is-nan@1.0.0 
  │ │ ├── is-fullwidth-code-point@1.0.0 
  │ │ └── mute-stream@0.0.5 
  │ ├─┬ run-async@0.1.0 
  │ │ └─┬ once@1.3.3 
  │ │   └── wrappy@1.0.2 
  │ ├── rx-lite@3.1.2 
  │ ├── string-width@1.0.1 
  │ └── through@2.3.8 
  ├─┬ metalsmith@2.1.0 
  │ ├── absolute@0.0.1 
  │ ├── async@0.9.2 
  │ ├─┬ chalk@0.5.1 
  │ │ ├── ansi-styles@1.1.0 
  │ │ ├─┬ has-ansi@0.1.0 
  │ │ │ └── ansi-regex@0.2.1 
  │ │ ├── strip-ansi@0.3.0 
  │ │ └── supports-color@0.2.0 
  │ ├── clone@0.1.19 
  │ ├─┬ co-fs-extra@0.0.2 
  │ │ ├─┬ co-fs@1.2.0 
  │ │ │ ├─┬ co-from-stream@0.0.0 
  │ │ │ │ └── co-read@0.0.1 
  │ │ │ └── thunkify@0.0.1 
  │ │ └─┬ fs-extra@0.12.0 
  │ │   ├── jsonfile@2.3.1 
  │ │   └── ncp@0.6.0 
  │ ├─┬ fs-extra@0.10.0 
  │ │ ├── jsonfile@1.2.0 
  │ │ ├─┬ mkdirp@0.5.1 
  │ │ │ └── minimist@0.0.8 
  │ │ └── ncp@0.5.1 
  │ ├─┬ gray-matter@2.0.2 
  │ │ ├─┬ ansi-red@0.1.1 
  │ │ │ └── ansi-wrap@0.1.0 
  │ │ ├─┬ extend-shallow@2.0.1 
  │ │ │ └── is-extendable@0.1.1 
  │ │ └─┬ js-yaml@3.6.1 
  │ │   ├─┬ argparse@1.0.7 
  │ │   │ └── sprintf-js@1.0.3 
  │ │   └── esprima@2.7.2 
  │ ├── has-generators@1.0.1 
  │ ├── is@2.2.1 
  │ ├── is-utf8@0.2.1 
  │ ├─┬ recursive-readdir@1.3.0 
  │ │ └─┬ minimatch@0.3.0 
  │ │   ├── lru-cache@2.7.3 
  │ │   └── sigmund@1.0.1 
  │ ├── stat-mode@0.2.1 
  │ ├── thunkify@2.1.2 
  │ ├─┬ unyield@0.0.1 
  │ │ └── co@3.1.0 
  │ ├─┬ ware@1.3.0 
  │ │ └── wrap-fn@0.1.5 
  │ └── win-fork@1.1.1 
  ├─┬ minimatch@3.0.2 
  │ └─┬ brace-expansion@1.1.6 
  │   ├── balanced-match@0.4.2 
  │   └── concat-map@0.0.1 
  ├─┬ ora@0.2.3 
  │ ├── cli-spinners@0.1.2 
  │ └── object-assign@4.1.0 
  ├─┬ read-metadata@1.0.0 
  │ └── yaml-js@0.0.8 
  ├─┬ request@2.74.0 
  │ ├── aws-sign2@0.6.0 
  │ ├── aws4@1.4.1 
  │ ├─┬ bl@1.1.2 
  │ │ └── readable-stream@2.0.6 
  │ ├── caseless@0.11.0 
  │ ├─┬ combined-stream@1.0.5 
  │ │ └── delayed-stream@1.0.0 
  │ ├── extend@3.0.0 
  │ ├── forever-agent@0.6.1 
  │ ├─┬ form-data@1.0.0-rc4 
  │ │ └── async@1.5.2 
  │ ├─┬ har-validator@2.0.6 
  │ │ ├─┬ is-my-json-valid@2.13.1 
  │ │ │ ├── generate-function@2.0.0 
  │ │ │ ├─┬ generate-object-property@1.2.0 
  │ │ │ │ └── is-property@1.0.2 
  │ │ │ ├── jsonpointer@2.0.0 
  │ │ │ └── xtend@4.0.1 
  │ │ └─┬ pinkie-promise@2.0.1 
  │ │   └── pinkie@2.0.4 
  │ ├─┬ hawk@3.1.3 
  │ │ ├── boom@2.10.1 
  │ │ ├── cryptiles@2.0.5 
  │ │ ├── hoek@2.16.3 
  │ │ └── sntp@1.0.9 
  │ ├─┬ http-signature@1.1.1 
  │ │ ├── assert-plus@0.2.0 
  │ │ ├─┬ jsprim@1.3.0 
  │ │ │ ├── extsprintf@1.0.2 
  │ │ │ ├── json-schema@0.2.2 
  │ │ │ └── verror@1.3.6 
  │ │ └─┬ sshpk@1.9.2 
  │ │   ├── asn1@0.2.3 
  │ │   ├── assert-plus@1.0.0 
  │ │   ├─┬ dashdash@1.14.0 
  │ │   │ └── assert-plus@1.0.0 
  │ │   ├── ecc-jsbn@0.1.1 
  │ │   ├─┬ getpass@0.1.6 
  │ │   │ └── assert-plus@1.0.0 
  │ │   ├── jodid25519@1.0.2 
  │ │   ├── jsbn@0.1.0 
  │ │   └── tweetnacl@0.13.3 
  │ ├── is-typedarray@1.0.0 
  │ ├── isstream@0.1.2 
  │ ├── json-stringify-safe@5.0.1 
  │ ├─┬ mime-types@2.1.11 
  │ │ └── mime-db@1.23.0 
  │ ├── node-uuid@1.4.7 
  │ ├── oauth-sign@0.8.2 
  │ ├── qs@6.2.1 
  │ ├── stringstream@0.0.5 
  │ ├── tough-cookie@2.3.1 
  │ └── tunnel-agent@0.4.3 
  ├─┬ rimraf@2.5.4 
  │ └─┬ glob@7.0.5 
  │   ├── fs.realpath@1.0.0 
  │   ├── inflight@1.0.5 
  │   ├── inherits@2.0.1 
  │   └── path-is-absolute@1.0.0 
  ├── semver@5.3.0 
  ├── uid@0.0.2 
  └─┬ validate-npm-package-name@2.2.2 
    └── builtins@0.0.7 

localhost:~ liyang$ ls
Applications    Downloads   Movies      Public
Desktop     IdeaProjects    Music       PycharmProjects
Documents   Library     Pictures    node_modules
localhost:~ liyang$ cd Desktop/
localhost:Desktop liyang$ ls
BlogImg             csrfnoDjangousenot.webarchive
Resource            vueDemo.html
WD My Cloud
localhost:Desktop liyang$ cd Resource/
localhost:Resource liyang$ LS
Android     Hadoop      Server
Front end   Install plugin  WebUtils
localhost:Resource liyang$ CD fR
/usr/bin/CD: line 4: cd: fR: No such file or directory
localhost:Resource liyang$ cd Front\ end/
localhost:Front end liyang$ ls
Demo        VueApplication
localhost:Front end liyang$ mkdir vue-cli-build
localhost:Front end liyang$ cd vue-cli-build/
localhost:vue-cli-build liyang$ cd ../
localhost:Front end liyang$ rm -rf vue-cli-build/
localhost:Front end liyang$ vue init vue-cli-project

? Generate project in current directory? Yes
   vue-cli · Template does not exist: vuejs-templates/vue-cli-project

localhost:Front end liyang$ vue init webpack vue-cli-project

? Project name vue-cli
? Project description vue build demo
? Author ly
? Use ESLint to lint your code? Yes
? Pick an ESLint preset Standard
? Setup unit tests with Karma + Mocha? Yes
? Setup e2e tests with Nightwatch? Yes

   vue-cli · Generated "vue-cli-project".

   To get started:

     cd vue-cli-project
     npm install
     npm run dev

   Documentation can be found at https://vuejs-templates.github.io/webpack

localhost:Front end liyang$ 
Vue项目构建进阶:从npm run dev到build的工程化实践 在现代前端开发中,构建工具是连接开发与生产环境的核心桥梁。其原理在于将源代码通过模块打包、代码转换和优化处理,最终生成可在浏览器中高效运行的静态资源。这一过程的技术价值在于提升应用性能、保障稳定性和优化用户体验。常见的应用场景包括单页应用(SPA)开发、多环境部署和持续集成流水线。本文聚焦Vue项目构建,深入解析npm run dev与npm run build背后的配置差异,涵盖热模块替换(HMR)、代码分割等关键热词,并探讨如何通过Webpack/Vite优化、环境变量管理和Nginx部署策略,实现从“ 阅读详情

相关推荐

SPA部署Nginx刷新404问题:从原理到实战的完整解决方案

单页应用(SPA)是现代前端开发的主流架构模式,它通过客户端路由实现页面无刷新切换,提升了用户体验。其核心原理是利用前端路由库(如Vue Router、React Router)在浏览器端管理URL与组件映射,而服务器仅提供静态资源。然而,当SPA部署到Nginx等静态服务器时,刷新非根路径页面常出现404错误,这是因为服务器试图寻找对应物理文件而非返回入口文件。解决这一问题的技术关键在于配置Nginx的try_files指令,将未匹配的请求回退到index.html,让前端路由接管。这一方案不仅解决了部署

weixin_34239169的博客 535

npm install 出现npm WARN tar ENOENT: no such file or directory, ..../node_modules/.staging/...解决办法

npm install 一直失败,出现以下: npm WARN tar ENOENT: no such file or directory, lstat '/demo/node_modules/.staging/stylelint-f14e63b6/lib/rules/declaration-property-unit-blacklist' npm WARN tar ENOENT: no su...

晏紫苏_cc的博客 7万+

Vue项目部署全攻略:从构建到Nginx配置与自动化上线

在现代Web开发中,前端项目的部署上线是连接开发与生产环境的关键环节。其核心原理在于将开发阶段的源代码通过构建工具(如Webpack或Vite)打包、压缩和优化,生成静态资源文件,以实现高性能与小体积。这一过程的技术价值在于确保应用在生产环境的稳定性、安全性和访问速度。典型的应用场景包括将单页应用(SPA)部署到云服务器,并通过Nginx等Web服务器提供高效的静态文件服务和路由管理。其中,**Nginx配置**是实现SPA路由Fallback(回退)的核心,而**环境变量**的管理则是保障前后端API正确

congji3817的博客 398

react-native node解决tar ENOENT: no such file or directory, open '/node_modules/.staging/react-native-

tar ENOENT: no such file or directory, open '/node_modules/.staging/react-native-fetch-blob' 这个是由于node(版本?)的原因造成的,解决方法分别执行下面三个命名,第一个需要输入密码 sudo npm cache clean -f sudo npm install -g n

jia611的专栏 1万+

SPA部署本质:静态托管、路由回退与基础路径三大核心

单页面应用(SPA)是一种前端完全接管路由的Web架构,其部署不同于传统多页应用,核心依赖静态文件托管能力、客户端路由回退(fallback)机制和构建产物的基础路径(base URL)精准控制。理解这三者原理,是避免404、白屏、资源加载失败等高频问题的技术前提。在工程实践中,Vercel、Cloudflare Pages等平台的价值不在于免费额度,而在于对SPA约束的原生支持程度;而base配置错误、fallback缺失、环境变量注入失效等,则是导致部署失败的典型技术断点。本文聚焦Vue/Vite等主流

cuili5839的博客 487

SPA首屏加载优化全攻略:从代码构建到渲染执行的性能提升方案

单页应用(SPA)是现代Web开发的主流架构,它通过动态加载内容提供流畅的用户体验。其核心原理在于客户端渲染,但这也带来了首屏加载缓慢的挑战,主要源于JavaScript包体积过大和网络请求延迟。优化SPA性能的技术价值在于提升用户体验、改善SEO排名并提高转化率。应用场景广泛,涵盖电商、社交平台、管理后台等各类Web应用。本文聚焦于**代码分割**和**懒加载**等关键技术,通过减小资源体积、优化加载顺序来加速首屏渲染。结合构建工具配置、网络传输优化和渲染策略,为开发者提供一套从源头到终端的完整性能提升方

weixin_30599769的博客 309

(已解决)npm WARN tar ENOENT: no such file or directory, open

然后另外npm install xxx@版本号,安装成功后再重新npm install一次,就可以install成功了。npm WARN tarball tarball data for xxx@版本号,看是哪个包没有安装成功导致的。

weixin_45725679的博客 4430

利用 Openocd 和 FT2232H 实现 ARMv8(Coretex-A53)高效调试方案

本文详细介绍了如何利用开源工具OpenOCD与高性能USB转接芯片FT2232H,构建一套针对ARMv8架构(如Cortex-A53)的高效、低成本调试方案。内容涵盖从环境搭建、驱动配置、核心调试架构解析到实战问题排查的全过程,帮助开发者实现对多核处理器的透明、可控调试,是嵌入式Linux及底层开发的实用指南。

weixin_29163581的博客 281

vue项目初始化出现tar ENOENT: no such file or directory错误的解决办法。

在npm install时,出现了tar ENOENT: no such file or directory报错。 原因:node的版本问题 解决办法:全局环境下更新node版本,或者使用公司内部包装过后的的 node ,按照顺序运行下面的语句 sudo npm cache clean -f sudo npm install -g n sudo n stable 此时会更换node的版...

Lucky小黄人的博客 4958

Shopee 虾皮API接口:商品详情采集的实践

随着电商行业的蓬勃发展,数据采集和分析在商业决策中扮演着越来越重要的角色。Shopee作为东南亚领先的电商平台,拥有大量的商品数据。通过Shopee的API接口,我们可以方便地获取商品详情,为数据分析和市场研究提供有力支持。本文将介绍如何使用Shopee API接口采集商品详情,并分享一些实践技巧。提供了丰富的数据接口,包括商品详情、店铺信息、订单数据等。通过API接口,开发者可以轻松地获取Shopee平台上的数据,进行进一步的处理和分析。Shopee API接口:商品详情采集的实践与技巧。

An4480的博客 1893

思科网络进阶——多生成树协议(MSTP)配置的一课一得

三、实验拓扑1)设计一个网络架构,要有核心层和接入层,都使用思科交换机。2)企业有4个部门,要求这四个部门都可以上网,但分属不同的VLAN中,这样今后可以做其它安全策略以确保网络安全,这些策略如今后学到的访问控制列表ACL。3)网络架构的设计要具有冗余,防止一条线路或一台设备终端导致的业务中断。4)由于硬件冗余而产生的环路要处理好,也就是要在逻辑上(或者说通过配置)防止物理环路的产生。5)不能因为防止物理环路而导致某端口没有流量,这样浪费端口资源及设备间互联的带宽资源。

zhu52010的博客 3400

npm WARN tar ENOENT: no such file or directory, open node_modules/.staging/core-js-0af08198/stage/RE

都不行,删除了package-lock.json和node_modules,重新安装都不行,原来是因为我用的v14.19.3版本,直到我切换为v12.22.12版本之后重新安装就好了。为什么我想到用v12.22.12呢,因为我们线上就用这个版本,一直跑的都没问题。一开始搜索,按照这上面说的方法。

风烟 2095

1.4 你绝对不能错过的天气查询工具:MCP 标准化接入实战

本文介绍了如何构建一个符合MCP标准的天气查询服务。通过FastMCP框架集成OpenWeatherMap API,实现实时天气、天气预报和历史天气查询功能。文章详细展示了从环境准备、插件设计到控制器实现的完整流程,包括如何定义工具函数、配置路由和中间件。同时讲解了如何将MCP服务封装为LangChain工具并与DeepSeek等大模型集成,还涵盖了缓存、限流等高级特性。该示例演示了如何将任意API标准化为MCP服务,为Agent应用提供统一接口。

yonggeit的博客 3049

Windows下Nginx部署Vue SPA的完整实战指南

Vue单页应用(SPA)依赖前端路由机制,而Nginx作为静态服务器默认按路径查找物理文件,二者存在天然逻辑冲突;当Vue使用history模式时,未配置`try_files`会导致刷新404,这是Web部署中最典型的动静态协同问题。理解Nginx的location匹配、root/alias路径解析、Windows服务注册机制,是解决白屏、跨域代理失败、日志权限异常等高频问题的核心。本文聚焦Windows平台下Nginx与Vue CLI构建产物的集成实践,覆盖安装路径规范、服务化部署、SPA路由兜底、反向代

weixin_34372728的博客 305

05 - GRACE数据处理-球谐展开与球谐综合

GRACE数据处理-球谐展开和综合前面在介绍GRACE相关理论的时候提到过下面的公式,从公式形式上可以看出,面密度变化和球谐系数(CS)之间是能够相互转换的,那这个转化的过程可以称为球谐展开,简单理解就是将全球网格数据转化为球谐系数的过程。而球谐综合可以看作是球谐展开的逆过程,利用球谐系数计算到全球格网分布。

weixin_43339605的博客 1051

实战优化!C#上位机串口通信卡顿问题:超时机制+数据缓存方案

串口名</param>/// <param name="baudRate">波特率

这里只有干货:从 Modbus 通信到 MES 对接,从 YOLO 训练到工控机部署,带你搞定工业软件开发全流程。 1068

Flash Attention 与 HuggingFace Transformers 集成实战:从开启、调优到故障排查

本篇技术指南以 AI-Research-SKILLs 仓库中 [transformers-integration.md](https://link.gitcode.com/i/46c583dc23f7e1a355875852527b3680) 为核心,系统讲解如何在 HuggingFace Transformers(v4.36+)中原生启用 Flash Attention 2,覆盖支持的模型架构、

gitblog_00025的博客 825

STM32F103待机模式原理与低功耗实战指南

待机模式是嵌入式系统实现超低功耗的核心机制,其本质是通过切断内核域电源(VDD/VDDA)实现微安级静态电流,区别于睡眠/停止模式的状态保持特性。原理上依赖电源域隔离、WKUP引脚事件唤醒与RTC备份域协同,技术价值在于支撑电池供电设备长达数年续航。典型应用场景包括物联网传感器节点、智能电表、便携医疗设备等对功耗极度敏感的终端。工程落地需严格遵循GPIO模拟输入配置、唤醒标志清除、备份域解锁等关键步骤,避免因漏电或误唤醒导致实测电流超标。本文以STM32F103为例,深入解析待机模式的硬件基础与HAL库实现

weixin_32999557的博客 68

Vue3 Vant4 Mobile部署指南:Vercel/Netlify/服务器多平台发布教程

- 框架预设选择"Vue.js" 2. **配置构建参数**(系统会自动读取vercel.json配置) - 构建命令:`pnpm build` - 输出目录:`dist` 3. **部署完成** 点击"Deploy"后,Vercel会自动完成构建和部署,生成一个默认域名。你也可以在项目设置中绑定自定义域名。 ## 三、Netlify部署:灵活的持续集成方案 Netlif

gitblog_00761的博客 812

R语言使用caret包的confusionMatrix函数计算混淆矩阵、使用编写的自定义函数可视化混淆矩阵(confusion matrix)

R语言使用caret包的confusionMatrix函数计算混淆矩阵、使用编写的自定义函数可视化混淆矩阵(confusion matrix)

data+scenario+science+insight 3930

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

Vue CLI 工程化本质:从 vue create 到现代前端开发契约

单页应用(SPA)是现代 Web 应用的标准形态,其核心依赖于模块化构建、运行时加载与开发调试一体化的工程体系。Vue CLI 作为 Vue 官方构建工具,将 Webpack、Babel、ESLint 等复杂配置抽象为可交互的标准化流程,实现‘约定优于配置’的工程实践。它不仅封装了 SPA 所需的路由、状态管理、样式预处理等能力,更通过 @vue/cli-service 提供可演进的服务层与安全的配置扩展机制(如 vue.config.js),保障团队协作效率与长期维护性。在 TypeScript、Vue

weixin_33802505的博客 372

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

X-BUILD与Vite2深度集成:现代前端构建工具的完美搭配指南 [特殊字符]

X-BUILD是一款基于Vite2 + Vue3 + TypeScript的前端脚手架工具,它通过深度集成Vite2构建工具,为开发者提供了极致的开发体验和构建性能。在本文中,我们将详细探讨X-BUILD如何与Vite2完美结合,打造现代化前端开发工作流。💡 ## 为什么选择X-BUILD与Vite2的组合? ### 闪电般的开发启动速度 ⚡ X-BUILD利用Vite2的原生ES模块特性

gitblog_01050的博客 697

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

Vue项目从WebStorm开发到Nginx部署全链路实战指南

前端开发的核心流程通常涵盖本地编码、构建优化与生产环境部署三大环节。其基本原理是通过构建工具将Vue、React等框架的源代码编译、打包成浏览器可直接解析的静态资源(HTML、CSS、JavaScript)。这一过程的技术价值在于实现代码压缩、资源优化和环境隔离,从而提升应用性能和安全性。在实际工程实践中,构建产物的部署依赖于Nginx等Web服务器进行托管与分发。针对单页应用(SPA),关键的Nginx配置如try_files指令,能有效支持Vue Router的history模式,避免页面刷新出现404

weixin_34392435的博客 370

Vue-Admin-Webapp部署指南:从开发环境到生产环境的快速部署方案

想要快速搭建专业的Vue.js后台管理系统吗?vue-admin-webapp为您提供了一个完整的解决方案!这个基于Vue 2和Element UI构建的后台管理SPA项目,集成了登录权限验证、动态路由生成、图表展示等核心功能,是企业级管理系统的理想选择。本文将为您详细介绍从开发环境搭建到生产环境部署的完整流程,帮助您快速上手这个功能强大的后台管理系统。🚀 ## 环境准备与项目获取 ###

gitblog_00658的博客 754

Grok Build与Netlify插件集成:自动化前端构建部署全流程指南

在现代前端工程化实践中,静态站点构建与部署的自动化是提升开发效率和保障发布质量的核心环节。构建工具通过编译、打包和优化源代码,生成浏览器可直接运行的静态资源,其原理在于将模块化代码转换为高效的生产环境产物。这一技术价值体现在大幅减少手动操作,实现持续集成与持续部署(CI/CD),从而加速迭代周期。常见的应用场景包括企业官网、博客、文档站点等静态内容托管。本文聚焦于Grok Build这一新兴构建工具,并深入探讨其与Netlify平台的官方插件集成,通过环境变量管理和构建缓存优化等关键功能,实现从代码提交到线

weixin_33907511的博客 553

Vite多入口配置实战:Vue3项目架构与路由管理指南

在现代前端工程化实践中,构建工具的多入口配置是管理复杂项目架构的关键技术。其核心原理是通过配置构建工具的入口选项,将多个独立的HTML页面作为独立入口进行打包,实现资源的物理隔离和独立部署。这项技术的核心价值在于能够将不同功能模块解耦,支持混合应用架构(MPA与SPA并存),显著提升大型项目的可维护性和部署灵活性。在Vue3技术栈中,结合Vite构建工具,开发者可以高效实现多入口配置,并为每个入口独立配置Vue Router路由系统。本文聚焦Vite多入口配置的工程实践,详细解析如何通过rollupOpti

weixin_33670713的博客 534
上一篇: HomeBrew for mac to install node npm
下一篇: Django Api 设计指南
一朵红杏
博客等级 码龄12年 51粉丝 282原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值