1、安裝配置GIT
git --version
如果已安裝,則執行ssh命令,獲取公鑰,綁定gitlab
ssh-keygen -t rsa -C "郵箱賬號"
配置成功顯示如圖:
將密鑰復制到GitHub中,操作步驟如下:
先執行SSH命令,將密鑰復制出來
cat /Users/rouwanzhi/.ssh/id_rsa.pub
執行結果如下:
打開GitHub網址,登陸賬號,按照圖中1、2、3、4的順序依次點擊,並將密鑰復制到第三步即可,如圖:
最后,檢查GitHub是否配置完成,輸入命令
ssh -T git@github.com
中間會提示Are you sure you want to continue connecting (yes/no/[fingerprint])? 點擊yes即可,最后安裝成功提示如下:
最后將自己常用的用戶名和郵箱配置上
rouwanzhi@rouwanzhideMBP ~ % git config --global user.name "用戶名" rouwanzhi@rouwanzhideMBP ~ % git config --global user.email "郵箱"
2、配置從GitHub上克隆的VUE項目
第一步,執行克隆命令
rouwanzhi@rouwanzhideMBP ~ % git clone https://github.com/shuiRong/VueCnodeJS.git
此步驟會報錯,報錯信息如下
正克隆到 'VueCnodeJS'... remote: Enumerating objects: 583, done. remote: Counting objects: 100% (11/11), done. remote: Compressing objects: 100% (11/11), done. remote: Total 583 (delta 0), reused 3 (delta 0), pack-reused 572 接收對象中: 100% (583/583), 1.21 MiB | 986.00 KiB/s, 完成. 處理 delta 中: 100% (278/278), 完成. rouwanzhi@rouwanzhideMBP ~ % cd VueCnodeJS rouwanzhi@rouwanzhideMBP VueCnodeJS % npm install npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2. npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies. npm ERR! code 1 npm ERR! path /Users/rouwanzhi/VueCnodeJS/node_modules/node-sass npm ERR! command failed npm ERR! command sh -c node scripts/build.js npm ERR! Building: /usr/local/bin/node /Users/rouwanzhi/VueCnodeJS/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library= npm ERR! gyp info it worked if it ends with ok npm ERR! gyp verb cli [ npm ERR! gyp verb cli '/usr/local/bin/node', npm ERR! gyp verb cli '/Users/rouwanzhi/VueCnodeJS/node_modules/node-gyp/bin/node-gyp.js', npm ERR! gyp verb cli 'rebuild', npm ERR! gyp verb cli '--verbose', npm ERR! gyp verb cli '--libsass_ext=', npm ERR! gyp verb cli '--libsass_cflags=', npm ERR! gyp verb cli '--libsass_ldflags=', npm ERR! gyp verb cli '--libsass_library=' npm ERR! gyp verb cli ] npm ERR! gyp info using node-gyp@3.8.0 npm ERR! gyp info using node@14.17.1 | darwin | x64 npm ERR! gyp verb command rebuild [] npm ERR! gyp verb command clean [] npm ERR! gyp verb clean removing "build" directory npm ERR! gyp verb command configure [] npm ERR! gyp verb check python checking for Python executable "python2" in the PATH npm ERR! gyp verb `which` succeeded python2 /usr/bin/python2 npm ERR! gyp verb check python version `/usr/bin/python2 -c "import sys; print "2.7.16 npm ERR! gyp verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j npm ERR! gyp verb get node dir no --target version specified, falling back to host node version: 14.17.1 npm ERR! gyp verb command install [ '14.17.1' ] npm ERR! gyp verb install input version string "14.17.1" npm ERR! gyp verb install installing version: 14.17.1 npm ERR! gyp verb install --ensure was passed, so won't reinstall if already installed npm ERR! gyp verb install version is already installed, need to check "installVersion" npm ERR! gyp verb got "installVersion" 9 npm ERR! gyp verb needs "installVersion" 9 npm ERR! gyp verb install version is good npm ERR! gyp verb get node dir target node version installed: 14.17.1 npm ERR! gyp verb build dir attempting to create "build" dir: /Users/rouwanzhi/VueCnodeJS/node_modules/node-sass/build npm ERR! gyp verb build dir "build" dir needed to be created? /Users/rouwanzhi/VueCnodeJS/node_modules/node-sass/build npm ERR! gyp verb build/config.gypi creating config file npm ERR! gyp verb build/config.gypi writing out config file: /Users/rouwanzhi/VueCnodeJS/node_modules/node-sass/build/config.gypi npm ERR! gyp verb config.gypi checking for gypi file: /Users/rouwanzhi/VueCnodeJS/node_modules/node-sass/config.gypi npm ERR! gyp verb common.gypi checking for gypi file: /Users/rouwanzhi/VueCnodeJS/node_modules/node-sass/common.gypi npm ERR! gyp verb gyp gyp format was not specified; forcing "make" npm ERR! gyp info spawn /usr/bin/python2 npm ERR! gyp info spawn args [ npm ERR! gyp info spawn args '/Users/rouwanzhi/VueCnodeJS/node_modules/node-gyp/gyp/gyp_main.py', npm ERR! gyp info spawn args 'binding.gyp', npm ERR! gyp info spawn args '-f', npm ERR! gyp info spawn args 'make', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/Users/rouwanzhi/VueCnodeJS/node_modules/node-sass/build/config.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/Users/rouwanzhi/VueCnodeJS/node_modules/node-gyp/addon.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/Users/rouwanzhi/.node-gyp/14.17.1/include/node/common.gypi', npm ERR! gyp info spawn args '-Dlibrary=shared_library', npm ERR! gyp info spawn args '-Dvisibility=default', npm ERR! gyp info spawn args '-Dnode_root_dir=/Users/rouwanzhi/.node-gyp/14.17.1', npm ERR! gyp info spawn args '-Dnode_gyp_dir=/Users/rouwanzhi/VueCnodeJS/node_modules/node-gyp', npm ERR! gyp info spawn args '-Dnode_lib_file=/Users/rouwanzhi/.node-gyp/14.17.1/<(target_arch)/node.lib', npm ERR! gyp info spawn args '-Dmodule_root_dir=/Users/rouwanzhi/VueCnodeJS/node_modules/node-sass', npm ERR! gyp info spawn args '-Dnode_engine=v8', npm ERR! gyp info spawn args '--depth=.', npm ERR! gyp info spawn args '--no-parallel', npm ERR! gyp info spawn args '--generator-output', npm ERR! gyp info spawn args 'build', npm ERR! gyp info spawn args '-Goutput_dir=.' npm ERR! gyp info spawn args ] npm ERR! No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'. npm ERR! npm ERR! No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'. npm ERR! npm ERR! No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'. npm ERR! npm ERR! gyp: No Xcode or CLT version detected! npm ERR! gyp ERR! configure error npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1 npm ERR! gyp ERR! stack at ChildProcess.onCpExit (/Users/rouwanzhi/VueCnodeJS/node_modules/node-gyp/lib/configure.js:345:16) npm ERR! gyp ERR! stack at ChildProcess.emit (events.js:375:28) npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12) npm ERR! gyp ERR! System Darwin 20.5.0 npm ERR! gyp ERR! command "/usr/local/bin/node" "/Users/rouwanzhi/VueCnodeJS/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library=" npm ERR! gyp ERR! cwd /Users/rouwanzhi/VueCnodeJS/node_modules/node-sass npm ERR! gyp ERR! node -v v14.17.1 npm ERR! gyp ERR! node-gyp -v v3.8.0 npm ERR! gyp ERR! not ok npm ERR! Build failed with error code: 1 npm ERR! A complete log of this run can be found in: npm ERR! /Users/rouwanzhi/.npm/_logs/2021-07-19T01_49_00_326Z-debug.log rouwanzhi@rouwanzhideMBP VueCnodeJS % npm i -g npm changed 17 packages, and audited 257 packages in 8s 11 packages are looking for funding run `npm fund` for details found 0 vulnerabilities
這個時候不要慌,我們配置一下就好,執行以下命令
sudo npm install -g cnpm --registry=https://registry.npm.taobao.org --verbose
接着輸入密碼,安裝成功如下圖所示:
接下來我們驗證一下 ,輸入命令
cnpm -v
安裝成功,如下圖所示:
cnpm@7.0.0 (/opt/homebrew/lib/node_modules/cnpm/lib/parse_argv.js) npm@6.14.13 (/opt/homebrew/lib/node_modules/cnpm/node_modules/npm/lib/npm.js) node@14.17.1 (/usr/local/bin/node) npminstall@5.0.1 (/opt/homebrew/lib/node_modules/cnpm/node_modules/npminstall/lib/index.js) prefix=/opt/homebrew darwin x64 20.5.0 registry=https://registry.nlark.com
到這步就基本解決了報錯問題,那么我們回到最開始克隆的鏈接,接着克隆
rouwanzhi@rouwanzhideMBP ~ % git clone https://github.com/shuiRong/VueCnodeJS.git
克隆完成后,我們打開克隆好的文件夾
cd VueCnodeJS
進行配置
cnpm install
配置成功如下所示:
最后一步是啟動本地服務器,執行命令
npm run serve
成功命令如下圖所示:
測試其他項目,也成功了,代碼如下:
rouwanzhi@rouwanzhideMBP ~ % git clone https://github.com/Armour/vue-typescript-admin-template.git 正克隆到 'vue-typescript-admin-template'... remote: Enumerating objects: 4361, done. remote: Counting objects: 100% (185/185), done. remote: Compressing objects: 100% (163/163), done. remote: Total 4361 (delta 27), reused 144 (delta 19), pack-reused 4176 接收對象中: 100% (4361/4361), 9.91 MiB | 1.15 MiB/s, 完成. 處理 delta 中: 100% (2280/2280), 完成. rouwanzhi@rouwanzhideMBP ~ % cd vue-typescript-admin-template rouwanzhi@rouwanzhideMBP vue-typescript-admin-template % cnpm install ✔ Installed 93 packages ✔ Linked 1367 latest versions [1/7] scripts.postinstall core-js@^3.10.0 run "node -e \"try{require('./postinstall')}catch(e){}\"", root: "/Users/rouwanzhi/vue-typescript-admin-template/node_modules/_core-js@3.15.2@core-js" Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library! The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: > https://opencollective.com/core-js > https://www.patreon.com/zloirock Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -) [1/7] scripts.postinstall core-js@^3.10.0 finished in 110ms [2/7] scripts.postinstall element-ui@2.15.3 › async-validator@1.8.5 › babel-runtime@6.26.0 › core-js@^2.4.0 run "node -e \"try{require('./postinstall')}catch(e){}\"", root: "/Users/rouwanzhi/vue-typescript-admin-template/node_modules/_core-js@2.6.12@core-js" [2/7] scripts.postinstall element-ui@2.15.3 › async-validator@1.8.5 › babel-runtime@6.26.0 › core-js@^2.4.0 finished in 72ms [3/7] scripts.postinstall @vue/cli-service@4.5.13 › webpack-bundle-analyzer@3.9.0 › ejs@^2.6.1 run "node ./postinstall.js", root: "/Users/rouwanzhi/vue-typescript-admin-template/node_modules/_ejs@2.7.4@ejs" Thank you for installing EJS: built with the Jake JavaScript build tool (https://jakejs.com/) [3/7] scripts.postinstall @vue/cli-service@4.5.13 › webpack-bundle-analyzer@3.9.0 › ejs@^2.6.1 finished in 68ms [4/7] scripts.install fibers@^5.0.0 run "node build.js || nodejs build.js", root: "/Users/rouwanzhi/vue-typescript-admin-template/node_modules/_fibers@5.0.0@fibers" `darwin-x64-83` exists; testing Binary is fine; exiting [4/7] scripts.install fibers@^5.0.0 finished in 534ms [5/7] scripts.install @vue/cli-service@4.5.13 › webpack-dev-server@3.11.2 › chokidar@2.1.8 › fsevents@^1.2.7 run "node install.js", root: "/Users/rouwanzhi/vue-typescript-admin-template/node_modules/_fsevents@1.2.13@fsevents" SOLINK_MODULE(target) Release/.node CXX(target) Release/obj.target/fse/fsevents.o SOLINK_MODULE(target) Release/fse.node [5/7] scripts.install @vue/cli-service@4.5.13 › webpack-dev-server@3.11.2 › chokidar@2.1.8 › fsevents@^1.2.7 finished in 2s [6/7] scripts.install @vue/cli-plugin-eslint@4.5.13 › yorkie@^2.0.0 run "node bin/install.js", root: "/Users/rouwanzhi/vue-typescript-admin-template/node_modules/_yorkie@2.0.0@yorkie" setting up Git hooks done [6/7] scripts.install @vue/cli-plugin-eslint@4.5.13 › yorkie@^2.0.0 finished in 95ms [7/7] scripts.install @vue/cli-plugin-unit-jest@4.5.13 › vue-jest@3.0.7 › deasync@^0.1.15 run "node ./build.js", root: "/Users/rouwanzhi/vue-typescript-admin-template/node_modules/_deasync@0.1.21@deasync" `darwin-x64-node-14` exists; testing Binary is fine; exiting [7/7] scripts.install @vue/cli-plugin-unit-jest@4.5.13 › vue-jest@3.0.7 › deasync@^0.1.15 finished in 837ms ✔ Run 7 scripts peerDependencies link ajv@6.12.6 in /Users/rouwanzhi/vue-typescript-admin-template/node_modules/_ajv-keywords@3.5.2@ajv-keywords unmet with /Users/rouwanzhi/vue-typescript-admin-template/node_modules/ajv(8.6.2) peerDependencies link ajv@6.12.6 in /Users/rouwanzhi/vue-typescript-admin-template/node_modules/_ajv-errors@1.0.1@ajv-errors unmet with /Users/rouwanzhi/vue-typescript-admin-template/node_modules/ajv(8.6.2) peerDependencies link webpack@4.46.0 in /Users/rouwanzhi/vue-typescript-admin-template/node_modules/_thread-loader@2.1.3@thread-loader unmet with /Users/rouwanzhi/vue-typescript-admin-template/node_modules/webpack(5.45.1) peerDependencies link webpack@4.46.0 in /Users/rouwanzhi/vue-typescript-admin-template/node_modules/_terser-webpack-plugin@1.4.5@terser-webpack-plugin unmet with /Users/rouwanzhi/vue-typescript-admin-template/node_modules/webpack(5.45.1) peerDependencies link webpack@4.46.0 in /Users/rouwanzhi/vue-typescript-admin-template/node_modules/_@intervolga_optimize-cssnano-plugin@1.0.6@@intervolga/optimize-cssnano-plugin unmet with /Users/rouwanzhi/vue-typescript-admin-template/node_modules/webpack(5.45.1) peerDependencies link webpack@4.46.0 in /Users/rouwanzhi/vue-typescript-admin-template/node_modules/_@soda_friendly-errors-webpack-plugin@1.8.0@@soda/friendly-errors-webpack-plugin unmet with /Users/rouwanzhi/vue-typescript-admin-template/node_modules/webpack(5.45.1) peerDependencies link webpack@4.46.0 in /Users/rouwanzhi/vue-typescript-admin-template/node_modules/_@vue_preload-webpack-plugin@1.1.2@@vue/preload-webpack-plugin unmet with /Users/rouwanzhi/vue-typescript-admin-template/node_modules/webpack(5.45.1) peerDependencies link webpack@4.46.0 in /Users/rouwanzhi/vue-typescript-admin-template/node_modules/_html-webpack-plugin@3.2.0@html-webpack-plugin unmet with /Users/rouwanzhi/vue-typescript-admin-template/node_modules/webpack(5.45.1) peerDependencies link webpack@4.46.0 in /Users/rouwanzhi/vue-typescript-admin-template/node_modules/_vue-loader@15.9.7@vue-loader unmet with /Users/rouwanzhi/vue-typescript-admin-template/node_modules/webpack(5.45.1) peerDependencies link webpack@4.46.0 in /Users/rouwanzhi/vue-typescript-admin-template/node_modules/_webpack-dev-server@3.11.2@webpack-dev-server unmet with /Users/rouwanzhi/vue-typescript-admin-template/node_modules/webpack(5.45.1) peerDependencies link webpack@4.46.0 in /Users/rouwanzhi/vue-typescript-admin-template/node_modules/_cache-loader@4.1.0@cache-loader unmet with /Users/rouwanzhi/vue-typescript-admin-template/node_modules/webpack(5.45.1) peerDependencies link webpack@4.46.0 in /Users/rouwanzhi/vue-typescript-admin-template/node_modules/_eslint-loader@2.2.1@eslint-loader unmet with /Users/rouwanzhi/vue-typescript-admin-template/node_modules/webpack(5.45.1) peerDependencies link webpack@4.46.0 in /Users/rouwanzhi/vue-typescript-admin-template/node_modules/_workbox-webpack-plugin@4.3.1@workbox-webpack-plugin unmet with /Users/rouwanzhi/vue-typescript-admin-template/node_modules/webpack(5.45.1) peerDependencies link webpack@4.46.0 in /Users/rouwanzhi/vue-typescript-admin-template/node_modules/_file-loader@4.3.0@file-loader unmet with /Users/rouwanzhi/vue-typescript-admin-template/node_modules/webpack(5.45.1) peerDependencies link webpack@4.46.0 in /Users/rouwanzhi/vue-typescript-admin-template/node_modules/_mini-css-extract-plugin@0.9.0@mini-css-extract-plugin unmet with /Users/rouwanzhi/vue-typescript-admin-template/node_modules/webpack(5.45.1) peerDependencies link webpack@4.46.0 in /Users/rouwanzhi/vue-typescript-admin-template/node_modules/_url-loader@2.3.0@url-loader unmet with /Users/rouwanzhi/vue-typescript-admin-template/node_modules/webpack(5.45.1) peerDependencies link webpack@4.46.0 in /Users/rouwanzhi/vue-typescript-admin-template/node_modules/_copy-webpack-plugin@5.1.2@copy-webpack-plugin unmet with /Users/rouwanzhi/vue-typescript-admin-template/node_modules/webpack(5.45.1) peerDependencies link webpack@4.46.0 in /Users/rouwanzhi/vue-typescript-admin-template/node_modules/_css-loader@3.6.0@css-loader unmet with /Users/rouwanzhi/vue-typescript-admin-template/node_modules/webpack(5.45.1) peerDependencies link webpack@4.46.0 in /Users/rouwanzhi/vue-typescript-admin-template/node_modules/_webpack-dev-middleware@3.7.3@webpack-dev-middleware unmet with /Users/rouwanzhi/vue-typescript-admin-template/node_modules/webpack(5.45.1) peerDependencies link acorn@7.4.1 in /Users/rouwanzhi/vue-typescript-admin-template/node_modules/_acorn-jsx@5.3.2@acorn-jsx unmet with /Users/rouwanzhi/vue-typescript-admin-template/node_modules/acorn(8.4.1) peerDependencies WARNING @vue/cli-plugin-typescript@^4.5.12 requires a peer of @vue/compiler-sfc@^3.0.0-beta.14 but none was installed peerDependencies WARNING @vue/cli-service@^4.5.12 requires a peer of @vue/compiler-sfc@^3.0.0-beta.14 but none was installed peerDependencies WARNING sass-loader@^10.1.1 requires a peer of node-sass@^4.0.0 || ^5.0.0 || ^6.0.0 but none was installed peerDependencies WARNING @vue/cli-plugin-eslint@^4.5.12 requires a peer of eslint@>= 1.6.0 < 7.0.0 but eslint@7.31.0 was installed peerDependencies WARNING ts-jest@^26.5.4 requires a peer of jest@>=26 <27 but jest@24.9.0 was installed peerDependencies WARNING @vue/cli-plugin-unit-jest@4.5.13 › jest-environment-jsdom-fifteen@1.0.2 › jsdom@^15.2.1 requires a peer of canvas@^2.5.0 but none was installed peerDependencies WARNING @vue/cli-plugin-unit-jest@4.5.13 › jest-environment-jsdom-fifteen@1.0.2 › jsdom@15.2.1 › ws@^7.0.0 requires a peer of bufferutil@^4.0.1 but none was installed peerDependencies WARNING @vue/cli-plugin-eslint@4.5.13 › eslint-loader@^2.2.1 requires a peer of eslint@>=1.6.0 <7.0.0 but eslint@7.31.0 was installed peerDependencies WARNING @vue/cli-plugin-unit-jest@4.5.13 › jest-environment-jsdom-fifteen@1.0.2 › jsdom@15.2.1 › ws@^7.0.0 requires a peer of utf-8-validate@^5.0.2 but none was installed deprecate @types/clipboard@^2.0.1 This is a stub types definition. clipboard provides its own type definitions, so you do not need this installed. deprecate element-ui@2.15.3 › async-validator@1.8.5 › babel-runtime@6.26.0 › core-js@^2.4.0 core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js. deprecate @types/vuedraggable@^2.23.2 This is a stub types definition. vuedraggable provides its own type definitions, so you do not need this installed. anti semver @types/morgan@1.9.3 › @types/node@* delcares @types/node@*(resolved as 16.3.3) but using ancestor(root package.json)'s dependency @types/node@^14.14.37(resolved as 14.17.5) deprecate jsonlint@1.6.3 › nomnom@^1.5.x Package no longer supported. Contact support@npmjs.com for more info. anti semver @types/express@4.17.13 › @types/body-parser@1.19.1 › @types/node@* delcares @types/node@*(resolved as 16.3.3) but using ancestor(root package.json)'s dependency @types/node@^14.14.37(resolved as 14.17.5) anti semver @types/express@4.17.13 › @types/serve-static@1.13.10 › @types/node@* delcares @types/node@*(resolved as 16.3.3) but using ancestor(root package.json)'s dependency @types/node@^14.14.37(resolved as 14.17.5) anti semver @types/express@4.17.13 › @types/express-serve-static-core@4.17.24 › @types/node@* delcares @types/node@*(resolved as 16.3.3) but using ancestor(root package.json)'s dependency @types/node@^14.14.37(resolved as 14.17.5) deprecate @vue/cli-service@4.5.13 › html-webpack-plugin@^3.2.0 3.x is no longer supported deprecate @vue/cli-service@4.5.13 › webpack-dev-server@3.11.2 › chokidar@^2.1.8 Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies. anti semver @vue/cli-plugin-eslint@4.5.13 › globby@9.2.0 › @types/glob@7.1.4 › @types/node@* delcares @types/node@*(resolved as 16.3.3) but using ancestor(root package.json)'s dependency @types/node@^14.14.37(resolved as 14.17.5) deprecate @vue/cli-plugin-eslint@4.5.13 › eslint-loader@^2.2.1 This loader has been deprecated. Please use eslint-webpack-plugin anti semver @vue/cli-service@4.5.13 › @types/webpack@4.41.30 › @types/node@* delcares @types/node@*(resolved as 16.3.3) but using ancestor(root package.json)'s dependency @types/node@^14.14.37(resolved as 14.17.5) deprecate @vue/cli-service@4.5.13 › webpack-dev-server@3.11.2 › chokidar@2.1.8 › fsevents@^1.2.7 fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2. anti semver ts-jest@26.5.6 › jest-util@26.6.2 › @types/node@* delcares @types/node@*(resolved as 16.3.3) but using ancestor(root package.json)'s dependency @types/node@^14.14.37(resolved as 14.17.5) deprecate @vue/cli-plugin-babel@4.5.13 › @vue/cli-shared-utils@4.5.13 › @hapi/joi@^15.0.1 Switch to 'npm install joi' deprecate @vue/cli-plugin-babel@4.5.13 › @vue/cli-shared-utils@4.5.13 › request@^2.88.2 request has been deprecated, see https://github.com/request/request/issues/3142 deprecate @vue/cli-plugin-babel@4.5.13 › webpack@4.46.0 › node-libs-browser@2.2.1 › url@0.11.0 › querystring@0.2.0 The anti semver @types/jest@26.0.24 › pretty-format@26.6.2 › @jest/types@26.6.2 › @types/node@* delcares @types/node@*(resolved as 16.3.3) but using ancestor(root package.json)'s dependency @types/node@^14.14.37(resolved as 14.17.5) anti semver @types/express@4.17.13 › @types/body-parser@1.19.1 › @types/connect@3.4.35 › @types/node@* delcares @types/node@*(resolved as 16.3.3) but using ancestor(root package.json)'s dependency @types/node@^14.14.37(resolved as 14.17.5) deprecate @vue/cli-plugin-babel@4.5.13 › @vue/cli-shared-utils@4.5.13 › @hapi/joi@15.1.1 › @hapi/address@2.x.x Moved to 'npm install @sideway/address' deprecate @vue/cli-plugin-babel@4.5.13 › @vue/cli-shared-utils@4.5.13 › @hapi/joi@15.1.1 › @hapi/bourne@1.x.x This version has been deprecated and is no longer supported or maintained deprecate @vue/cli-plugin-babel@4.5.13 › @vue/cli-shared-utils@4.5.13 › @hapi/joi@15.1.1 › @hapi/hoek@8.x.x This version has been deprecated and is no longer supported or maintained deprecate @vue/cli-plugin-babel@4.5.13 › @vue/cli-shared-utils@4.5.13 › @hapi/joi@15.1.1 › @hapi/topo@3.x.x This version has been deprecated and is no longer supported or maintained deprecate @vue/cli-plugin-babel@4.5.13 › @vue/cli-shared-utils@4.5.13 › request@2.88.2 › har-validator@~5.1.3 this library is no longer supported deprecate @vue/cli-plugin-babel@4.5.13 › webpack@4.46.0 › micromatch@3.1.10 › snapdragon@0.8.2 › source-map-resolve@0.5.3 › resolve-url@^0.2.1 https://github.com/lydell/resolve-url#deprecated deprecate @vue/cli-plugin-babel@4.5.13 › webpack@4.46.0 › micromatch@3.1.10 › snapdragon@0.8.2 › source-map-resolve@0.5.3 › urix@^0.1.0 Please see https://github.com/lydell/urix#deprecated anti semver webpack@5.45.1 › terser-webpack-plugin@5.1.4 › jest-worker@27.0.6 › @types/node@* delcares @types/node@*(resolved as 16.3.3) but using ancestor(root package.json)'s dependency @types/node@^14.14.37(resolved as 14.17.5) anti semver @vue/cli-service@4.5.13 › @types/webpack@4.41.30 › @types/webpack-sources@2.1.1 › @types/node@* delcares @types/node@*(resolved as 16.3.3) but using ancestor(root package.json)'s dependency @types/node@^14.14.37(resolved as 14.17.5) anti semver @vue/cli-service@4.5.13 › @types/webpack-dev-server@3.11.5 › @types/connect-history-api-fallback@1.3.5 › @types/node@* delcares @types/node@*(resolved as 16.3.3) but using ancestor(root package.json)'s dependency @types/node@^14.14.37(resolved as 14.17.5) deprecate @vue/cli-plugin-unit-jest@4.5.13 › jest-environment-jsdom-fifteen@1.0.2 › jsdom@15.2.1 › request-promise-native@^1.0.7 request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142 anti semver @vue/cli-service@4.5.13 › @types/webpack-dev-server@3.11.5 › http-proxy-middleware@1.3.1 › @types/http-proxy@1.17.7 › @types/node@* delcares @types/node@*(resolved as 16.3.3) but using ancestor(root package.json)'s dependency @types/node@^14.14.37(resolved as 14.17.5) deprecate @vue/cli-plugin-unit-jest@4.5.13 › jest@24.9.0 › jest-cli@24.9.0 › jest-config@24.9.0 › jest-environment-jsdom@24.9.0 › jsdom@11.12.0 › left-pad@^1.3.0 use String.prototype.padStart() Recently updated (since 2021-07-12): 23 packages (detail see file /Users/rouwanzhi/vue-typescript-admin-template/node_modules/.recently_updates.txt) ✔ All packages installed (1670 packages installed from npm registry, used 1m(network 1m), speed 891.01KB/s, json 1367(4.75MB), tarball 50.6MB) rouwanzhi@rouwanzhideMBP vue-typescript-admin-template % npm run preview npm ERR! Missing script: "preview" npm ERR! npm ERR! To see a list of scripts, run: npm ERR! npm run npm ERR! A complete log of this run can be found in: npm ERR! /Users/rouwanzhi/.npm/_logs/2021-07-19T04_45_16_097Z-debug.log rouwanzhi@rouwanzhideMBP vue-typescript-admin-template % npm run serve > vue-typescript-admin-template@1.0.0 serve > concurrently "npm:mock" "vue-cli-service serve" [mock] [mock] > vue-typescript-admin-template@1.0.0 mock [mock] > cd mock && ts-node-dev mock-server.ts [mock] [1] INFO Starting development server... [mock] [INFO] 12:45:51 ts-node-dev ver. 1.1.8 (using ts-node ver. 9.1.1, typescript ver. 4.2.3) [1] Starting type checking service... [1] Using 1 worker with 2048MB memory limit [mock] { [mock] info: { [mock] name: 'Mock API', [mock] description: 'Mock API for vue-typescript-admin-template.', [mock] version: '1.0.0' [mock] }, [mock] paths: { [mock] get: [ [mock] '/mock-api/v1/articles', [mock] '/mock-api/v1/articles/:id', [mock] '/mock-api/v1/pageviews', [mock] '/mock-api/v1/transactions', [mock] '/mock-api/v1/roles', [mock] '/mock-api/v1/routes', [mock] '/mock-api/v1/users', [mock] '/mock-api/v1/users/:username' [mock] ], [mock] post: [ [mock] '/mock-api/v1/articles', [mock] '/mock-api/v1/roles', [mock] '/mock-api/v1/users/register', [mock] '/mock-api/v1/users/login', [mock] '/mock-api/v1/users/logout', [mock] '/mock-api/v1/users/info' [mock] ], [mock] put: [ [mock] '/mock-api/v1/articles/:id', [mock] '/mock-api/v1/roles/:id', [mock] '/mock-api/v1/users/:username' [mock] ], [mock] delete: [ [mock] '/mock-api/v1/articles/:id', [mock] '/mock-api/v1/roles/:id', [mock] '/mock-api/v1/users/:username' [mock] ] [mock] } [mock] } [mock] Mock server started on port 9528! [1] DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0. [1] [1] Recommendation: math.div(1, 5) [1] [1] More info and automated migrator: https://sass-lang.com/d/slash-div [1] [1] ╷ [1] 489 │ $--group-option-flex: 0 0 (1/5) * 100% !default; [1] │ ^^^ [1] ╵ [1] node_modules/_element-ui@2.15.3@element-ui/packages/theme-chalk/src/common/var.scss 489:28 @import [1] node_modules/_element-ui@2.15.3@element-ui/packages/theme-chalk/src/common/transition.scss 1:9 @import [1] node_modules/_element-ui@2.15.3@element-ui/packages/theme-chalk/src/base.scss 1:9 @import [1] node_modules/_element-ui@2.15.3@element-ui/packages/theme-chalk/src/index.scss 1:9 @import [1] src/styles/element-variables.scss 61:9 root stylesheet [1] [1] DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0. [1] [1] Recommendation: math.div($--tooltip-arrow-size, 2) [1] [1] More info and automated migrator: https://sass-lang.com/d/slash-div [1] [1] ╷ [1] 32 │ margin-right: #{$--tooltip-arrow-size / 2}; [1] │ ^^^^^^^^^^^^^^^^^^^^^^^^^ [1] ╵ [1] node_modules/_element-ui@2.15.3@element-ui/packages/theme-chalk/src/popper.scss 32:21 @content [1] node_modules/_element-ui@2.15.3@element-ui/packages/theme-chalk/src/mixins/mixins.scss 74:5 b() [1] node_modules/_element-ui@2.15.3@element-ui/packages/theme-chalk/src/popper.scss 4:1 @import [1] node_modules/_element-ui@2.15.3@element-ui/packages/theme-chalk/src/select-dropdown.scss 3:9 @import [1] node_modules/_element-ui@2.15.3@element-ui/packages/theme-chalk/src/select.scss 4:9 @import [1] node_modules/_element-ui@2.15.3@element-ui/packages/theme-chalk/src/pagination.scss 4:9 @import [1] node_modules/_element-ui@2.15.3@element-ui/packages/theme-chalk/src/index.scss 2:9 @import [1] src/styles/element-variables.scss 61:9 root stylesheet [1] [1] DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0. [1] [1] Recommendation: math.div($--tooltip-arrow-size, 2) [1] [1] More info and automated migrator: https://sass-lang.com/d/slash-div [1] [1] ╷ [1] 51 │ margin-right: #{$--tooltip-arrow-size / 2}; [1] │ ^^^^^^^^^^^^^^^^^^^^^^^^^ [1] ╵ [1] node_modules/_element-ui@2.15.3@element-ui/packages/theme-chalk/src/popper.scss 51:21 @content [1] node_modules/_element-ui@2.15.3@element-ui/packages/theme-chalk/src/mixins/mixins.scss 74:5 b() [1] node_modules/_element-ui@2.15.3@element-ui/packages/theme-chalk/src/popper.scss 4:1 @import [1] node_modules/_element-ui@2.15.3@element-ui/packages/theme-chalk/src/select-dropdown.scss 3:9 @import [1] node_modules/_element-ui@2.15.3@element-ui/packages/theme-chalk/src/select.scss 4:9 @import [1] node_modules/_element-ui@2.15.3@element-ui/packages/theme-chalk/src/pagination.scss 4:9 @import [1] node_modules/_element-ui@2.15.3@element-ui/packages/theme-chalk/src/index.scss 2:9 @import [1] src/styles/element-variables.scss 61:9 root stylesheet [1] [1] DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0. [1] [1] Recommendation: math.div($--tooltip-arrow-size, 2) [1] [1] More info and automated migrator: https://sass-lang.com/d/slash-div [1] [1] ╷ [1] 70 │ margin-bottom: #{$--tooltip-arrow-size / 2}; [1] │ ^^^^^^^^^^^^^^^^^^^^^^^^^ [1] ╵ [1] node_modules/_element-ui@2.15.3@element-ui/packages/theme-chalk/src/popper.scss 70:22 @content [1] node_modules/_element-ui@2.15.3@element-ui/packages/theme-chalk/src/mixins/mixins.scss 74:5 b() [1] node_modules/_element-ui@2.15.3@element-ui/packages/theme-chalk/src/popper.scss 4:1 @import [1] node_modules/_element-ui@2.15.3@element-ui/packages/theme-chalk/src/select-dropdown.scss 3:9 @import [1] node_modules/_element-ui@2.15.3@element-ui/packages/theme-chalk/src/select.scss 4:9 @import [1] node_modules/_element-ui@2.15.3@element-ui/packages/theme-chalk/src/pagination.scss 4:9 @import [1] node_modules/_element-ui@2.15.3@element-ui/packages/theme-chalk/src/index.scss 2:9 @import [1] src/styles/element-variables.scss 61:9 root stylesheet [1] [1] DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0. [1] [1] Recommendation: math.div($--tooltip-arrow-size, 2) [1] [1] More info and automated migrator: https://sass-lang.com/d/slash-div [1] [1] ╷ [1] 89 │ margin-bottom: #{$--tooltip-arrow-size / 2}; [1] │ ^^^^^^^^^^^^^^^^^^^^^^^^^ [1] ╵ [1] node_modules/_element-ui@2.15.3@element-ui/packages/theme-chalk/src/popper.scss 89:22 @content [1] node_modules/_element-ui@2.15.3@element-ui/packages/theme-chalk/src/mixins/mixins.scss 74:5 b() [1] node_modules/_element-ui@2.15.3@element-ui/packages/theme-chalk/src/popper.scss 4:1 @import [1] node_modules/_element-ui@2.15.3@element-ui/packages/theme-chalk/src/select-dropdown.scss 3:9 @import [1] node_modules/_element-ui@2.15.3@element-ui/packages/theme-chalk/src/select.scss 4:9 @import [1] node_modules/_element-ui@2.15.3@element-ui/packages/theme-chalk/src/pagination.scss 4:9 @import [1] node_modules/_element-ui@2.15.3@element-ui/packages/theme-chalk/src/index.scss 2:9 @import [1] src/styles/element-variables.scss 61:9 root stylesheet [1] [1] WARNING: 33 repetitive deprecation warnings omitted. [1] [1] DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0. [1] [1] Recommendation: math.div($spacer, 2) [1] [1] More info and automated migrator: https://sass-lang.com/d/slash-div [1] [1] ╷ [1] 320 │ padding: $spacer $spacer $spacer $spacer / 2; [1] │ ^^^^^^^^^^^ [1] ╵ [1] src/components/MaterialInput/index.vue 320:38 root stylesheet [1] [1] DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0. [1] [1] Recommendation: math.div($spacer, 2) [1] [1] More info and automated migrator: https://sass-lang.com/d/slash-div [1] [1] ╷ [1] 393 │ padding-top: $spacer / 2; [1] │ ^^^^^^^^^^^ [1] ╵ [1] src/components/MaterialInput/index.vue 393:20 root stylesheet [1] [1] DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0. [1] [1] Recommendation: math.div($spacer, 2) [1] [1] More info and automated migrator: https://sass-lang.com/d/slash-div [1] [1] ╷ [1] 394 │ padding-right: $spacer / 2; [1] │ ^^^^^^^^^^^ [1] ╵ [1] src/components/MaterialInput/index.vue 394:22 root stylesheet [1] [1] DONE Compiled successfully in 30023ms下午12:46:23 [1] [1] ERROR in /Users/rouwanzhi/vue-typescript-admin-template/src/components/Breadcrumb/index.vue(52,18): [1] 52:18 Conversion of type '{ path: string; meta: { title: string; }; }' to type 'RouteRecord' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. [1] Type '{ path: string; meta: { title: string; }; }' is missing the following properties from type 'RouteRecord': regex, components, instances, props [1] 50 | const first = matched[0] [1] 51 | if (!this.isDashboard(first)) { [1] > 52 | matched = [{ path: '/dashboard', meta: { title: 'dashboard' } } as RouteRecord].concat(matched) [1] | ^ [1] 53 | } [1] 54 | this.breadcrumbs = matched.filter((item) => { [1] 55 | return item.meta && item.meta.title && item.meta.breadcrumb !== false [1] ERROR in /Users/rouwanzhi/vue-typescript-admin-template/src/components/HeaderSearch/index.vue(150,9): [1] 150:9 Object is possibly 'undefined'. [1] 148 | // generate internationalized title [1] 149 | const i18ntitle = i18n.t(`route.${router.meta.title}`).toString() [1] > 150 | data.meta.title = [...data.meta.title, i18ntitle] [1] | ^ [1] 151 | if (router.redirect !== 'noRedirect') { [1] 152 | // only push the routes with title [1] 153 | // special case: need to exclude parent router without redirect [1] ERROR in /Users/rouwanzhi/vue-typescript-admin-template/src/components/HeaderSearch/index.vue(150,31): [1] 150:31 Object is possibly 'undefined'. [1] 148 | // generate internationalized title [1] 149 | const i18ntitle = i18n.t(`route.${router.meta.title}`).toString() [1] > 150 | data.meta.title = [...data.meta.title, i18ntitle] [1] | ^ [1] 151 | if (router.redirect !== 'noRedirect') { [1] 152 | // only push the routes with title [1] 153 | // special case: need to exclude parent router without redirect [1] ERROR in /Users/rouwanzhi/vue-typescript-admin-template/src/components/HeaderSearch/index.vue(160,76): [1] 160:76 Object is possibly 'undefined'. [1] 158 | // recursive child routes [1] 159 | if (router.children) { [1] > 160 | const tempRoutes = this.generateRoutes(router.children, data.path, data.meta.title) [1] | ^ [1] 161 | if (tempRoutes.length >= 1) { [1] 162 | res = [...res, ...tempRoutes] [1] 163 | } [1] ERROR in /Users/rouwanzhi/vue-typescript-admin-template/src/components/LangSelect/index.vue(70,19): [1] 70:19 Object is possibly 'undefined'. [1] 68 | AppModule.SetLanguage(lang) [1] 69 | document.documentElement.lang = lang [1] > 70 | const title = this.$route.meta.title ? `${this.$t(`route.${this.$route.meta.title}`)} - ${settings.title}` : `${settings.title}` [1] | ^ [1] 71 | document.title = title [1] 72 | this.$message({ [1] 73 | message: this.$t('components.changeLanguageTips').toString(), [1] ERROR in /Users/rouwanzhi/vue-typescript-admin-template/src/components/LangSelect/index.vue(70,64): [1] 70:64 Object is possibly 'undefined'. [1] 68 | AppModule.SetLanguage(lang) [1] 69 | document.documentElement.lang = lang [1] > 70 | const title = this.$route.meta.title ? `${this.$t(`route.${this.$route.meta.title}`)} - ${settings.title}` : `${settings.title}` [1] | ^ [1] 71 | document.title = title [1] 72 | this.$message({ [1] 73 | message: this.$t('components.changeLanguageTips').toString(), [1] ERROR in /Users/rouwanzhi/vue-typescript-admin-template/src/layout/components/Sidebar/index.vue(75,9): [1] 75:9 Object is possibly 'undefined'. [1] 73 | const { meta, path } = route [1] 74 | // if set path, the sidebar will highlight the path you set [1] > 75 | if (meta.activeMenu) { [1] | ^ [1] 76 | return meta.activeMenu [1] 77 | } [1] 78 | return path [1] ERROR in /Users/rouwanzhi/vue-typescript-admin-template/src/layout/components/Sidebar/index.vue(76,14): [1] 76:14 Object is possibly 'undefined'. [1] 74 | // if set path, the sidebar will highlight the path you set [1] 75 | if (meta.activeMenu) { [1] > 76 | return meta.activeMenu [1] | ^ [1] 77 | } [1] 78 | return path [1] 79 | } [1] ERROR in /Users/rouwanzhi/vue-typescript-admin-template/src/permission.ts(80,33): [1] 80:33 Object is possibly 'undefined'. [1] 78 | [1] 79 | // set page title [1] > 80 | document.title = getPageTitle(to.meta.title) [1] | ^ [1] 81 | }) [1] 82 | [1] ERROR in /Users/rouwanzhi/vue-typescript-admin-template/src/store/modules/permission.ts(8,31): [1] 8:31 Object is possibly 'undefined'. [1] 6 | const hasPermission = (roles: string[], route: RouteConfig) => { [1] 7 | if (route.meta && route.meta.roles) { [1] > 8 | return roles.some(role => route.meta.roles.includes(role)) [1] | ^ [1] 9 | } else { [1] 10 | return true [1] 11 | } [1] ERROR in /Users/rouwanzhi/vue-typescript-admin-template/src/store/modules/tags-view.ts(24,16): [1] 24:16 Object is possibly 'undefined'. [1] 22 | this.visitedViews.push( [1] 23 | Object.assign({}, view, { [1] > 24 | title: view.meta.title || 'no-name' [1] | ^ [1] 25 | }) [1] 26 | ) [1] 27 | } [1] ERROR in /Users/rouwanzhi/vue-typescript-admin-template/src/store/modules/tags-view.ts(33,10): [1] 33:10 Object is possibly 'undefined'. [1] 31 | if (view.name === null) return [1] 32 | if (this.cachedViews.includes(view.name)) return [1] > 33 | if (!view.meta.noCache) { [1] | ^ [1] 34 | this.cachedViews.push(view.name) [1] 35 | } [1] 36 | } [1] ERROR in /Users/rouwanzhi/vue-typescript-admin-template/src/store/modules/tags-view.ts(58,14): [1] 58:14 Object is possibly 'undefined'. [1] 56 | private DEL_OTHERS_VISITED_VIEWS(view: ITagView) { [1] 57 | this.visitedViews = this.visitedViews.filter(v => { [1] > 58 | return v.meta.affix || v.path === view.path [1] | ^ [1] 59 | }) [1] 60 | } [1] 61 | [1] ERROR in /Users/rouwanzhi/vue-typescript-admin-template/src/store/modules/tags-view.ts(77,55): [1] 77:55 Object is possibly 'undefined'. [1] 75 | private DEL_ALL_VISITED_VIEWS() { [1] 76 | // keep affix tags [1] > 77 | const affixTags = this.visitedViews.filter(tag => tag.meta.affix) [1] | ^ [1] 78 | this.visitedViews = affixTags [1] 79 | } [1] 80 | [1] ERROR in /Users/rouwanzhi/vue-typescript-admin-template/src/views/permission/role.vue(190,36): [1] 190:36 Object is possibly 'undefined'. [1] 188 | path: '' [1] 189 | } [1] > 190 | tmp.title = this.$t(`route.${route.meta.title}`).toString() [1] | ^ [1] 191 | tmp.path = route.path [1] 192 | if (route.children) { [1] 193 | tmp.children = this.generateTreeData(route.children) [1] Version: typescript 4.2.3 [1] Time: 10328ms [1] [1] App running at: [1] - Local: http://localhost:9527/ [1] - Network: http://192.168.0.171:9527/ [1] [mock] POST /mock-api/v1/users/login 200 61.567 ms - 51 [mock] POST /mock-api/v1/users/info 200 6.021 ms - 283 [mock] GET /mock-api/v1/transactions 200 3.768 ms - - [mock] GET /mock-api/v1/routes 200 3.713 ms - - [mock] GET /mock-api/v1/roles 200 1.067 ms - - [mock] GET /mock-api/v1/articles 200 1.429 ms - - [mock] POST /mock-api/v1/users/logout 200 8.567 ms - 14 [mock] POST /mock-api/v1/users/login 200 5.169 ms - 51 [mock] POST /mock-api/v1/users/info 200 4.505 ms - 283 [mock] GET /mock-api/v1/articles?page=1&limit=10 200 2.824 ms - - [mock] GET /mock-api/v1/articles?page=1&limit=10 200 0.614 ms - - [mock] GET /mock-api/v1/articles?page=1&limit=20&sort=%2Bid 200 2.642 ms - - [mock] GET /mock-api/v1/articles?page=1&limit=20 200 0.833 ms - - [mock] GET /mock-api/v1/routes 200 2.349 ms - - [mock] GET /mock-api/v1/roles 200 0.812 ms - - [mock] GET /mock-api/v1/transactions 200 1.148 ms - -