折腾:
【记录】本地用后台管理页面框架搭建图表原型
期间,去
/Users/crifan/dev/dev_root/projects/通讯可视化/sourcecode/web ➜ web git clone https://github.com/PanJiaChen/vueAdmin-template.git Cloning into 'vueAdmin-template'... remote: Counting objects: 1040, done. remote: Compressing objects: 100% (39/39), done. remote: Total 1040 (delta 4), reused 29 (delta 1), pack-reused 998 Receiving objects: 100% (1040/1040), 558.83 KiB | 52.00 KiB/s, done. Resolving deltas: 100% (547/547), done. ➜ web cd vueAdmin-template ➜ vueAdmin-template git:(master) ll total 176 -rw-r--r-- 1 crifan staff 1.0K 7 12 22:17 LICENSE -rw-r--r-- 1 crifan staff 3.1K 7 12 22:17 README-zh.md -rw-r--r-- 1 crifan staff 2.2K 7 12 22:17 README.md drwxr-xr-x 10 crifan staff 320B 7 12 22:17 build drwxr-xr-x 5 crifan staff 160B 7 12 22:17 config -rw-r--r-- 1 crifan staff 66K 7 12 22:17 favicon.ico -rw-r--r-- 1 crifan staff 280B 7 12 22:17 index.html -rw-r--r-- 1 crifan staff 2.3K 7 12 22:17 package.json drwxr-xr-x 14 crifan staff 448B 7 12 22:17 src drwxr-xr-x 3 crifan staff 96B 7 12 22:17 static ➜ vueAdmin-template git:(master) npm install ...
然后由于网络太慢,中断了,继续,虽然npm install没问题
但是run dev出错了:
Downloading binary from https://github.com/sass/node-sass/releases/download/v4.9.2/darwin-x64-64_binding.node ➜ vueAdmin-template git:(master) ➜ vueAdmin-template git:(master) ➜ vueAdmin-template git:(master) npm install npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN [email protected] requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself. npm WARN [email protected] No repository field. up to date in 12.129s ➜ vueAdmin-template git:(master) npm run dev > [email protected] dev /Users/crifan/dev/dev_root/projects/通讯可视化/sourcecode/web/vueAdmin-template > webpack-dev-server --inline --progress --config build/webpack.dev.conf.js 94% asset optimization ERROR Failed to compile with 8 errors 22:21:49 error in ./src/styles/index.scss Module build failed: Error: Missing binding /Users/crifan/dev/dev_root/projects/通讯可视化/sourcecode/web/vueAdmin-template/node_modules/node-sass/vendor/darwin-x64-64/binding.node Node Sass could not find a binding for your current environment: OS X 64-bit with Node.js 10.x Found bindings for the following environments: - OS X 64-bit with Node.js 10.x This usually happens because your environment has changed since running `npm install`. Run `npm rebuild node-sass` to download the binding for your current environment. at module.exports (/Users/crifan/dev/dev_root/projects/通讯可视化/sourcecode/web/vueAdmin-template/node_modules/node-sass/lib/binding.js:15:13) at Object.<anonymous> (/Users/crifan/dev/dev_root/projects/通讯可视化/sourcecode/web/vueAdmin-template/node_modules/node-sass/lib/index.js:14:35) at Module._compile (internal/modules/cjs/loader.js:702:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10) at Module.load (internal/modules/cjs/loader.js:612:32) at tryModuleLoad (internal/modules/cjs/loader.js:551:12) at Function.Module._load (internal/modules/cjs/loader.js:543:3) at Module.require (internal/modules/cjs/loader.js:650:17) at require (internal/modules/cjs/helpers.js:20:18) at Object.<anonymous> (/Users/crifan/dev/dev_root/projects/通讯可视化/sourcecode/web/vueAdmin-template/node_modules/sass-loader/lib/loader.js:3:14) at Module._compile (internal/modules/cjs/loader.js:702:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10) at Module.load (internal/modules/cjs/loader.js:612:32) at tryModuleLoad (internal/modules/cjs/loader.js:551:12) at Function.Module._load (internal/modules/cjs/loader.js:543:3) at Module.require (internal/modules/cjs/loader.js:650:17) @ ./src/styles/index.scss 4:14-203 13:3-17:5 14:22-211 @ ./src/main.js @ multi (webpack)-dev-server/client? http://localhost:9528 webpack/hot/dev-server ./src/main.js error in ./src/views/404.vue
算了,删除目录,重新git clone试试
如果还是安装太慢,再去换taobao的registry
结果中间也是:报错找不到python2,并卡死的感觉:
➜ vueAdmin-template git:(master) npm install > [email protected] install /Users/crifan/dev/dev_root/projects/通讯可视化/sourcecode/web/vueAdmin-template/node_modules/fsevents > node install [fsevents] Success: "/Users/crifan/dev/dev_root/projects/通讯可视化/sourcecode/web/vueAdmin-template/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node" already installed Pass --update-binary to reinstall or --build-from-source to recompile > [email protected] install /Users/crifan/dev/dev_root/projects/通讯可视化/sourcecode/web/vueAdmin-template/node_modules/node-sass > node scripts/install.js Downloading binary from https://github.com/sass/node-sass/releases/download/v4.9.2/darwin-x64-64_binding.node Cannot download " https://github.com/sass/node-sass/releases/download/v4.9.2/darwin-x64-64_binding.node ": read ECONNRESET Hint: If github.com is not accessible in your location try setting a proxy via HTTP_PROXY, e.g. export HTTP_PROXY= http://example.com:1234 or configure npm proxy via npm config set proxy http://example.com:8080 > [email protected] postinstall /Users/crifan/dev/dev_root/projects/通讯可视化/sourcecode/web/vueAdmin-template/node_modules/webpack/node_modules/uglifyjs-webpack-plugin > node lib/post_install.js > [email protected] postinstall /Users/crifan/dev/dev_root/projects/通讯可视化/sourcecode/web/vueAdmin-template/node_modules/node-sass > node scripts/build.js Building: /Users/crifan/.nvm/versions/node/v10.4.0/bin/node /Users/crifan/dev/dev_root/projects/通讯可视化/sourcecode/web/vueAdmin-template/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library= gyp info it worked if it ends with ok gyp verb cli [ '/Users/crifan/.nvm/versions/node/v10.4.0/bin/node', gyp verb cli '/Users/crifan/dev/dev_root/projects/通讯可视化/sourcecode/web/vueAdmin-template/node_modules/node-gyp/bin/node-gyp.js', gyp verb cli 'rebuild', gyp verb cli '--verbose', gyp verb cli '--libsass_ext=', gyp verb cli '--libsass_cflags=', gyp verb cli '--libsass_ldflags=', gyp verb cli '--libsass_library=' ] gyp info using [email protected] gyp info using [email protected] | darwin | x64 gyp verb command rebuild [] gyp verb command clean [] gyp verb clean removing "build" directory gyp verb command configure [] gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR gyp verb download using dist-url https://nodejs.org/dist gyp verb check python checking for Python executable "python2" in the PATH gyp verb `which` failed Error: not found: python2 gyp verb `which` failed at getNotFoundError (/Users/crifan/dev/dev_root/projects/通讯可视化/sourcecode/web/vueAdmin-template/node_modules/which/which.js:13:12) gyp verb `which` failed at F (/Users/crifan/dev/dev_root/projects/通讯可视化/sourcecode/web/vueAdmin-template/node_modules/which/which.js:68:19) gyp verb `which` failed at E (/Users/crifan/dev/dev_root/projects/通讯可视化/sourcecode/web/vueAdmin-template/node_modules/which/which.js:80:29) gyp verb `which` failed at /Users/crifan/dev/dev_root/projects/通讯可视化/sourcecode/web/vueAdmin-template/node_modules/which/which.js:89:16 gyp verb `which` failed at /Users/crifan/dev/dev_root/projects/通讯可视化/sourcecode/web/vueAdmin-template/node_modules/isexe/index.js:42:5 gyp verb `which` failed at /Users/crifan/dev/dev_root/projects/通讯可视化/sourcecode/web/vueAdmin-template/node_modules/isexe/mode.js:8:5 gyp verb `which` failed at FSReqWrap.oncomplete (fs.js:184:21) gyp verb `which` failed python2 { Error: not found: python2 gyp verb `which` failed at getNotFoundError (/Users/crifan/dev/dev_root/projects/通讯可视化/sourcecode/web/vueAdmin-template/node_modules/which/which.js:13:12) gyp verb `which` failed at F (/Users/crifan/dev/dev_root/projects/通讯可视化/sourcecode/web/vueAdmin-template/node_modules/which/which.js:68:19) gyp verb `which` failed at E (/Users/crifan/dev/dev_root/projects/通讯可视化/sourcecode/web/vueAdmin-template/node_modules/which/which.js:80:29) gyp verb `which` failed at /Users/crifan/dev/dev_root/projects/通讯可视化/sourcecode/web/vueAdmin-template/node_modules/which/which.js:89:16 gyp verb `which` failed at /Users/crifan/dev/dev_root/projects/通讯可视化/sourcecode/web/vueAdmin-template/node_modules/isexe/index.js:42:5 gyp verb `which` failed at /Users/crifan/dev/dev_root/projects/通讯可视化/sourcecode/web/vueAdmin-template/node_modules/isexe/mode.js:8:5 gyp verb `which` failed at FSReqWrap.oncomplete (fs.js:184:21) gyp verb `which` failed stack: gyp verb `which` failed 'Error: not found: python2\n at getNotFoundError (/Users/crifan/dev/dev_root/projects/通讯可视化/sourcecode/web/vueAdmin-template/node_modules/which/which.js:13:12)\n at F (/Users/crifan/dev/dev_root/projects/通讯可视化/sourcecode/web/vueAdmin-template/node_modules/which/which.js:68:19)\n at E (/Users/crifan/dev/dev_root/projects/通讯可视化/sourcecode/web/vueAdmin-template/node_modules/which/which.js:80:29)\n at /Users/crifan/dev/dev_root/projects/通讯可视化/sourcecode/web/vueAdmin-template/node_modules/which/which.js:89:16\n at /Users/crifan/dev/dev_root/projects/通讯可视化/sourcecode/web/vueAdmin-template/node_modules/isexe/index.js:42:5\n at /Users/crifan/dev/dev_root/projects/通讯可视化/sourcecode/web/vueAdmin-template/node_modules/isexe/mode.js:8:5\n at FSReqWrap.oncomplete (fs.js:184:21)', gyp verb `which` failed code: 'ENOENT' } gyp verb check python checking for Python executable "python" in the PATH gyp verb `which` succeeded python /usr/bin/python gyp verb check python version `/usr/bin/python -c "import platform; print(platform.python_version());"` returned: "2.7.10\n" gyp verb get node dir no --target version specified, falling back to host node version: 10.4.0 gyp verb command install [ '10.4.0' ] gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR gyp verb download using dist-url https://nodejs.org/dist gyp verb install input version string "10.4.0" gyp verb install installing version: 10.4.0 gyp verb install --ensure was passed, so won't reinstall if already installed gyp verb install version not already installed, continuing with install 10.4.0 gyp verb ensuring nodedir is created /Users/crifan/.node-gyp/10.4.0 gyp verb created nodedir /Users/crifan/.node-gyp/10.4.0 gyp http GET https://nodejs.org/dist/v10.4.0/node-v10.4.0-headers.tar.gz gyp http 200 https://nodejs.org/dist/v10.4.0/node-v10.4.0-headers.tar.gz gyp verb extracted file from tarball include/node/android-ifaddrs.h gyp verb extracted file from tarball include/node/common.gypi gyp verb extracted file from tarball include/node/config.gypi gyp verb extracted file from tarball include/node/node.h gyp verb extracted file from tarball include/node/node_api.h gyp verb extracted file from tarball include/node/node_api_types.h gyp verb extracted file from tarball include/node/node_buffer.h gyp verb extracted file from tarball include/node/node_object_wrap.h gyp verb extracted file from tarball include/node/node_version.h gyp verb extracted file from tarball include/node/pthread-barrier.h gyp verb extracted file from tarball include/node/stdint-msvc2008.h gyp verb extracted file from tarball include/node/tree.h gyp verb extracted file from tarball include/node/uv-aix.h gyp verb extracted file from tarball include/node/uv-bsd.h gyp verb extracted file from tarball include/node/uv-darwin.h gyp verb extracted file from tarball include/node/uv-errno.h gyp verb extracted file from tarball include/node/uv-linux.h gyp verb extracted file from tarball include/node/uv-os390.h gyp verb extracted file from tarball include/node/uv-posix.h gyp verb extracted file from tarball include/node/uv-sunos.h gyp verb extracted file from tarball include/node/uv-threadpool.h gyp verb extracted file from tarball include/node/uv-unix.h gyp verb extracted file from tarball include/node/uv-version.h gyp verb extracted file from tarball include/node/uv-win.h gyp verb extracted file from tarball include/node/uv.h gyp verb extracted file from tarball include/node/v8-inspector-protocol.h gyp verb extracted file from tarball include/node/v8-inspector.h gyp verb extracted file from tarball include/node/v8-platform.h gyp verb extracted file from tarball include/node/v8-profiler.h gyp verb extracted file from tarball include/node/v8-testing.h gyp verb extracted file from tarball include/node/v8-util.h
试试:
npm install --registry= https://registry.npm.taobao.org
不过和没加参数没多大区别,还是很慢,很多东西还是从github上下载的(而不是以为的taobao)
最后终于install完毕了:
c++ '-DNODE_GYP_MODULE_NAME=binding' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/Users/crifan/.node-gyp/10.4.0/include/node -I/Users/crifan/.node-gyp/10.4.0/src -I/Users/crifan/.node-gyp/10.4.0/deps/openssl/config -I/Users/crifan/.node-gyp/10.4.0/deps/openssl/openssl/include -I/Users/crifan/.node-gyp/10.4.0/deps/uv/include -I/Users/crifan/.node-gyp/10.4.0/deps/zlib -I/Users/crifan/.node-gyp/10.4.0/deps/v8/include -I../../nan -I../src/libsass/include -Os -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++1y -stdlib=libc++ -fno-rtti -fno-exceptions -fno-threadsafe-statics -std=c++11 -MMD -MF ./Release/.deps/Release/obj.target/binding/src/sass_types/string.o.d.raw -c -o Release/obj.target/binding/src/sass_types/string.o ../src/sass_types/string.cpp c++ -bundle -undefined dynamic_lookup -Wl,-no_pie -Wl,-search_paths_first -mmacosx-version-min=10.7 -arch x86_64 -L./Release -stdlib=libc++ -o Release/binding.node Release/obj.target/binding/src/binding.o Release/obj.target/binding/src/create_string.o Release/obj.target/binding/src/custom_function_bridge.o Release/obj.target/binding/src/custom_importer_bridge.o Release/obj.target/binding/src/sass_context_wrapper.o Release/obj.target/binding/src/sass_types/boolean.o Release/obj.target/binding/src/sass_types/color.o Release/obj.target/binding/src/sass_types/error.o Release/obj.target/binding/src/sass_types/factory.o Release/obj.target/binding/src/sass_types/list.o Release/obj.target/binding/src/sass_types/map.o Release/obj.target/binding/src/sass_types/null.o Release/obj.target/binding/src/sass_types/number.o Release/obj.target/binding/src/sass_types/string.o Release/sass.a gyp info ok Installed to /Users/crifan/dev/dev_root/projects/通讯可视化/sourcecode/web/vueAdmin-template/node_modules/node-sass/vendor/darwin-x64-64/binding.node npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN [email protected] requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself. npm WARN [email protected] No repository field. added 1444 packages from 732 contributors in 305.304s ➜ vueAdmin-template git:(master)
【总结】
此处
npm install
或
npm install --registry= https://registry.npm.taobao.org
感觉效果都一样的慢。
中间停顿了,不要以为卡死了,多等一下就可以继续安装了。