【发布时间】:2022-01-17 09:22:16
【问题描述】:
代码在这里,用于生成 10,000 NFT gethub 链接 (https://github.com/codeSTACKr/video-source-code-create-nft-collection.git)
我安装了 NodeJ。在我的 m1 Mac 上,每次我尝试在 VsCode 中安装 npm 时都会出现此错误
video-source-code-create-nft-collection % npm install npm WARN read-shrinkwrap 这个版本的 npm 兼容 lockfileVersion@1,但是 package-lock.json 是为 lockfileVersion@2 生成的。我会努力做到最好的!
canvas@2.8.0 install /Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas node-pre-gyp install --fallback-to-build
node-pre-gyp 错误!安装响应状态 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.8.0/canvas-v2.8.0-node-v83-darwin-unknown-arm64.tar.gz
node-pre-gyp WARN 预构建的二进制文件不可安装用于 canvas@2.8.0 和 node@14.18.2(node-v83 ABI,未知)(回退到使用 node-gyp 编译的源代码)
node-pre-gyp WARN 命中错误响应状态 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.8.0/canvas-v2.8.0-node-v83-darwin-unknown-arm64.tar.gz
在 pkg-config 搜索路径中找不到软件包 pixman-1。
也许您应该添加包含 pixman-1.pc' to the PKG_CONFIG_PATH environment variable No package 'pixman-1' found gyp: Call to 'pkg-config pixman-1 --libs' returned exit status 1 while in binding.gyp. while trying to load binding.gyp gyp ERR! configure error gyp ERR! stack Error: gyp` 的目录 failed with exit code: 1
吉普错误! ChildProcess.onCpExit 的堆栈(/opt/homebrew/Cellar/node@14/14.18.2/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
吉普错误! ChildProcess.emit (events.js:400:28) 的堆栈
吉普错误!堆栈在 Process.ChildProcess._handle.onexit (internal/child_process.js:282:12)
吉普错误!系统达尔文 21.2.0
吉普错误!命令“/opt/homebrew/Cellar/node@14/14.18.2/bin/node”“/opt/homebrew/Cellar/node@14/14.18.2/lib/node_modules/npm/node_modules/node-gyp/bin /node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas/build/Release/canvas .node" "--module_name=canvas" "--module_path=/Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas/build/Release" "--napi_version=8" "-- node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v83"
吉普错误! cwd /Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas
吉普错误!节点-v v14.18.2
吉普错误!节点gyp -v v5.1.0
吉普错误!不好
节点预gyp错误!构建错误
节点预gyp错误!堆栈错误:无法执行'/opt/homebrew/Cellar/node@14/14.18.2/bin/node /opt/homebrew/Cellar/node@14/14.18.2/lib/node_modules/npm/node_modules/node- gyp/bin/node-gyp.js 配置 --fallback-to-build --module=/Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas/build/Release/canvas.node - -module_name=canvas --module_path=/Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label =节点-v83' (1)
节点预gyp错误! ChildProcess 的堆栈。 (/Users/ahmed/video-source-code-create-nft-collection/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
节点预gyp错误! ChildProcess.emit (events.js:400:28) 的堆栈
节点预gyp错误!堆栈在可能关闭(内部/child_process.js:1058:16)
节点预gyp错误!堆栈在 Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)
节点预gyp错误!系统达尔文 21.2.0
节点预gyp错误!命令“/opt/homebrew/Cellar/node@14/14.18.2/bin/node”“/Users/ahmed/video-source-code-create-nft-collection/node_modules/.bin/node-pre-gyp” “安装” “--fallback-to-build”
节点预gyp错误! cwd /Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas
节点预gyp错误!节点-v v14.18.2
节点预gyp错误!节点预gyp -v v1.0.6
节点预gyp错误!不好
ahmed@Ahmeds-MacBook-Pro 视频-源代码-创建-nft-collection % npm install
npm WARN read-shrinkwrap 这个版本的 npm 兼容 lockfileVersion@1,但是 package-lock.json 是为 lockfileVersion@2 生成的。我会努力做到最好的!
canvas@2.8.0 install /Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas node-pre-gyp install --fallback-to-build
node-pre-gyp 错误!安装响应状态 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.8.0/canvas-v2.8.0-node-v83-darwin-unknown-arm64.tar.gz
node-pre-gyp WARN 无法为 canvas@2.8.0 和 node@14.18.2 安装预构建的二进制文件(node-v83 ABI,未知)(回退到使用 node-gyp 进行源编译)
node-pre-gyp WARN 命中错误响应状态 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.8.0/canvas-v2.8.0-node-v83-darwin-unknown-arm64.tar.gz
在 pkg-config 搜索路径中找不到软件包 pixman-1。
也许你应该添加包含pixman-1.pc' to the PKG_CONFIG_PATH environment variable No package 'pixman-1' found gyp: Call to 'pkg-config pixman-1 --libs' returned exit status 1 while in binding.gyp. while trying to load binding.gyp gyp ERR! configure error gyp ERR! stack Error: gyp`的目录失败,退出代码:1
吉普错误! ChildProcess.onCpExit 的堆栈(/opt/homebrew/Cellar/node@14/14.18.2/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
吉普错误! ChildProcess.emit (events.js:400:28) 的堆栈
吉普错误!堆栈在 Process.ChildProcess._handle.onexit (internal/child_process.js:282:12)
吉普错误!系统达尔文 21.2.0
吉普错误!命令“/opt/homebrew/Cellar/node@14/14.18.2/bin/node”“/opt/homebrew/Cellar/node@14/14.18.2/lib/node_modules/npm/node_modules/node-gyp/bin /node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas/build/Release/canvas .node" "--module_name=canvas" "--module_path=/Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas/build/Release" "--napi_version=8" "-- node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v83"
吉普错误! cwd /Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas
吉普错误!节点-v v14.18.2
吉普错误!节点gyp -v v5.1.0
吉普错误!不好
节点预gyp错误!构建错误
节点预gyp错误!堆栈错误:无法执行'/opt/homebrew/Cellar/node@14/14.18.2/bin/node /opt/homebrew/Cellar/node@14/14.18.2/lib/node_modules/npm/node_modules/node- gyp/bin/node-gyp.js 配置 --fallback-to-build --module=/Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas/build/Release/canvas.node - -module_name=canvas --module_path=/Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label =节点-v83' (1)
节点预gyp错误! ChildProcess 的堆栈。 (/Users/ahmed/video-source-code-create-nft-collection/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
节点预gyp错误! ChildProcess.emit (events.js:400:28) 的堆栈
节点预gyp错误!堆栈在可能关闭(内部/child_process.js:1058:16)
节点预gyp错误!堆栈在 Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)
节点预gyp错误!系统达尔文 21.2.0
节点预gyp错误!命令“/opt/homebrew/Cellar/node@14/14.18.2/bin/node”“/Users/ahmed/video-source-code-create-nft-collection/node_modules/.bin/node-pre-gyp” “安装” “--fallback-to-build”
节点预gyp错误! cwd /Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas
节点预gyp错误!节点-v v14.18.2
节点预gyp错误!节点预gyp -v v1.0.6
节点预gyp错误!不好
无法执行'/opt/homebrew/Cellar/node@14/14.18.2/bin/node /opt/homebrew/Cellar/node@14/14.18.2/lib/node_modules/npm/node_modules/node-gyp/bin /node-gyp.js 配置 --fallback-to-build --module=/Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas/build/Release/canvas.node --module_name=画布 --module_path=/Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node- v83' (1)
npm WARN hashlips_art_engine@1.1.1 没有存储库字段。
npm 错误!代码生命周期
npm 错误!错误号 1
npm 错误! canvas@2.8.0 安装:node-pre-gyp install --fallback-to-build
npm 错误!退出状态 1
npm 错误!
npm 错误! canvas@2.8.0 安装脚本失败。
npm 错误!这可能不是 npm 的问题。上面可能还有额外的日志输出。
npm 错误!可以在以下位置找到此运行的完整日志: npm 错误! /Users/ahmed/.npm/_logs/2021-12-14T00_37_55_725Z-debug.log
【问题讨论】:
-
你尝试过 npm audit fix 吗?
-
当你在你的 vscode 终端中,你到底输入了什么然后收到错误?
-
尝试 npm uninstall lockversion,然后尝试 npm install lockversion@1
-
我输入 (npm install).... 我也尝试过 (npm i),但我得到了这个新错误(npm WARN hashlips_art_engine@1.1.1 No repository field. npm ERR! code ELIFECYCLE npm ERR !errno 1 npm ERR!canvas@2.8.0 install:
node-pre-gyp install --fallback-to-buildnpm ERR!退出状态 1 npm ERR!npm ERR!在 canvas@2.8.0 安装脚本失败。npm ERR!这可能不是 npm 的问题. 上面可能还有额外的日志输出。npm ERR!此运行的完整日志可以在以下位置找到:npm ERR!/Users/ahmed/.npm/_logs/2021-12-14T00_54_48_933Z-debug.log) -
我试过 npm install lockversion@1 并且我得到了这个错误(npm ERR!code E404 npm ERR!404 Not Found - GET registry.npmjs.org/lockversion - Not found npm ERR!404 npm ERR!404 'lockversion @1' 不在 npm 注册表中。npm ERR!404 你应该让作者发布它(或自己使用名称!) npm ERR!404 npm ERR!404 注意你也可以从 npm ERR!404 安装tarball、文件夹、http url 或 git url。npm ERR!此运行的完整日志可在以下位置找到:npm ERR!/Users/ahmed/.npm/_logs/2021-12-14T00_57_27_578Z-debug.log)跨度>
标签: node.js npm npm-install nvm