如何在 macbook pro 上安装 vue-visjs?

时间:2021-06-22 02:46:34

标签: vue.js installation vis.js

运行时

npm install --save vue-visjs

我收到了很多已弃用的消息,然后是错误。我的 mac 上必须配置错误。感谢您提供任何帮助。谢谢。以下错误:(我不知道为什么 Vis.js 需要加密库)。

npm WARN deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated eslint-loader@2.2.1: This loader has been deprecated. Please use eslint-webpack-plugin
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
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 html-webpack-plugin@3.2.0: 3.x is no longer supported
npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address'
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated node-pre-gyp@0.15.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
npm WARN deprecated @hapi/joi@15.1.1: Switch to 'npm install joi'
npm WARN deprecated core-js@2.6.12: 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.
npm ERR! code 1
npm ERR! path /Users/erlebach/src/2021/vue-visjs/node_modules/node-webcrypto-ossl
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@16.3.0 | darwin | x64
npm ERR! (node:5928) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
npm ERR! (Use `node --trace-deprecation ...` to show where the warning was created)
npm ERR! gyp info spawn /usr/bin/python2
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/Users/erlebach/src/2021/vue-visjs/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/erlebach/src/2021/vue-visjs/node_modules/node-webcrypto-ossl/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/erlebach/src/2021/vue-visjs/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/erlebach/.node-gyp/16.3.0/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/erlebach/.node-gyp/16.3.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/Users/erlebach/src/2021/vue-visjs/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/erlebach/.node-gyp/16.3.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/Users/erlebach/src/2021/vue-visjs/node_modules/node-webcrypto-ossl',
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/erlebach/src/2021/vue-visjs/node_modules/node-gyp/lib/configure.js:345:16)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:394:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Darwin 20.5.0
npm ERR! gyp ERR! command "/Users/erlebach/Documents/global_npm_installs/lib/node_modules/node/bin/node" "/Users/erlebach/src/2021/vue-visjs/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /Users/erlebach/src/2021/vue-visjs/node_modules/node-webcrypto-ossl
npm ERR! gyp ERR! node -v v16.3.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/erlebach/.npm/_logs/2021-06-21T22_28_56_414Z-debug.log

这是日志的错误部分,在这一点之前有很多行:

2763 error code 1
2764 error path /Users/erlebach/src/2021/vue-visjs/node_modules/node-webcrypto-ossl
2765 error command failed
2766 error command sh -c node-gyp rebuild
2767 error gyp info it worked if it ends with ok
2767 error gyp info using node-gyp@3.8.0
2767 error gyp info using node@16.3.0 | darwin | x64
2767 error (node:5928) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
2767 error (Use `node --trace-deprecation ...` to show where the warning was created)
2767 error gyp info spawn /usr/bin/python2
2767 error gyp info spawn args [
2767 error gyp info spawn args   '/Users/erlebach/src/2021/vue-visjs/node_modules/node-gyp/gyp/gyp_main.py',
2767 error gyp info spawn args   'binding.gyp',
2767 error gyp info spawn args   '-f',
2767 error gyp info spawn args   'make',
2767 error gyp info spawn args   '-I',
2767 error gyp info spawn args   '/Users/erlebach/src/2021/vue-visjs/node_modules/node-webcrypto-ossl/build/config.gypi',
2767 error gyp info spawn args   '-I',
2767 error gyp info spawn args   '/Users/erlebach/src/2021/vue-visjs/node_modules/node-gyp/addon.gypi',
2767 error gyp info spawn args   '-I',
2767 error gyp info spawn args   '/Users/erlebach/.node-gyp/16.3.0/include/node/common.gypi',
2767 error gyp info spawn args   '-Dlibrary=shared_library',
2767 error gyp info spawn args   '-Dvisibility=default',
2767 error gyp info spawn args   '-Dnode_root_dir=/Users/erlebach/.node-gyp/16.3.0',
2767 error gyp info spawn args   '-Dnode_gyp_dir=/Users/erlebach/src/2021/vue-visjs/node_modules/node-gyp',
2767 error gyp info spawn args   '-Dnode_lib_file=/Users/erlebach/.node-gyp/16.3.0/<(target_arch)/node.lib',
2767 error gyp info spawn args   '-Dmodule_root_dir=/Users/erlebach/src/2021/vue-visjs/node_modules/node-webcrypto-ossl',
2767 error gyp info spawn args   '-Dnode_engine=v8',
2767 error gyp info spawn args   '--depth=.',
2767 error gyp info spawn args   '--no-parallel',
2767 error gyp info spawn args   '--generator-output',
2767 error gyp info spawn args   'build',
2767 error gyp info spawn args   '-Goutput_dir=.'
2767 error gyp info spawn args ]
2767 error No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.
2767 error
2767 error No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.
2767 error
2767 error No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.
2767 error
2767 error gyp: No Xcode or CLT version detected!
2767 error gyp ERR! configure error
2767 error gyp ERR! stack Error: `gyp` failed with exit code: 1
2767 error gyp ERR! stack     at ChildProcess.onCpExit (/Users/erlebach/src/2021/vue-visjs/node_modules/node-gyp/lib/configure.js:345:16)
2767 error gyp ERR! stack     at ChildProcess.emit (node:events:394:28)
2767 error gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
2767 error gyp ERR! System Darwin 20.5.0
2767 error gyp ERR! command "/Users/erlebach/Documents/global_npm_installs/lib/node_modules/node/bin/node" "/Users/erlebach/src/2021/vue-visjs/node_modules/.bin/node-gyp" "rebuild"
2767 error gyp ERR! cwd /Users/erlebach/src/2021/vue-visjs/node_modules/node-webcrypto-ossl
2767 error gyp ERR! node -v v16.3.0
2767 error gyp ERR! node-gyp -v v3.8.0
2767 error gyp ERR! not ok
2768 verbose exit 1

1 个答案:

答案 0 :(得分:0)

最后一个错误可能是最有帮助的:

2767 error gyp: No Xcode or CLT version detected!

这表明您的系统可能缺少 XCode,这是用于在 macOS 上构建库的常用 SDK。 result with layer hidden 需要 XCode 开发者工具来构建原生 macOS 模块。

以下是要遵循的故障排除步骤:

  1. 通过在命令行中使用 xcode-select 打印 XCode 工具的路径来确定您是否已经安装了 XCode:

    $ xcode-select --print-path
    
  2. 如果打印的路径没有错误,您只需要使用以下命令重置终端的 PATH 设置:

    $ xcode-select --reset
    
  3. 如果该工具显示您没有安装 XCode,您可以打开一个对话框进行安装:

    $ xcode-select --install
    
  4. 然后重新启动 shell 以确保 PATH 具有新安装的 XCode 工具路径设置。