MrAhmed Alhamed
MrAhmed Alhamed

Reputation: 233

npm ERR I can't install npm m1 MacBook

the code is here its for generate 10,000 NFT gethub link (https://github.com/codeSTACKr/video-source-code-create-nft-collection.git)

I installed NodeJs. on my m1 Mac and every time I try to install npm inside the VsCode I get this error I'm new to programing idk how can fix it I've been struggling for 2 weeks now

video-source-code-create-nft-collection % npm install npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!

[email protected] install /Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! install response status 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 Pre-built binaries not installable for [email protected] and [email protected] (node-v83 ABI, unknown) (falling back to source compile with node-gyp) node-pre-gyp WARN Hit error response status 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 Package pixman-1 was not found in the pkg-config search path. Perhaps you should add the directory containing 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 gyp ERR! stack at ChildProcess.onCpExit (/opt/homebrew/Cellar/node@14/14.18.2/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16) gyp ERR! stack at ChildProcess.emit (events.js:400:28) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:282:12) gyp ERR! System Darwin 21.2.0 gyp ERR! command "/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" gyp ERR! cwd /Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas gyp ERR! node -v v14.18.2 gyp ERR! node-gyp -v v5.1.0 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute '/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' (1) node-pre-gyp ERR! stack at ChildProcess. (/Users/ahmed/video-source-code-create-nft-collection/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:400:28) node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1058:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5) node-pre-gyp ERR! System Darwin 21.2.0 node-pre-gyp ERR! command "/opt/homebrew/Cellar/node@14/14.18.2/bin/node" "/Users/ahmed/video-source-code-create-nft-collection/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd /Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas node-pre-gyp ERR! node -v v14.18.2 node-pre-gyp ERR! node-pre-gyp -v v1.0.6 node-pre-gyp ERR! not ok ahmed@Ahmeds-MacBook-Pro video-source-code-create-nft-collection % npm install npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!

[email protected] install /Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! install response status 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 Pre-built binaries not installable for [email protected] and [email protected] (node-v83 ABI, unknown) (falling back to source compile with node-gyp) node-pre-gyp WARN Hit error response status 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 Package pixman-1 was not found in the pkg-config search path. Perhaps you should add the directory containing 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 gyp ERR! stack at ChildProcess.onCpExit (/opt/homebrew/Cellar/node@14/14.18.2/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16) gyp ERR! stack at ChildProcess.emit (events.js:400:28) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:282:12) gyp ERR! System Darwin 21.2.0 gyp ERR! command "/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" gyp ERR! cwd /Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas gyp ERR! node -v v14.18.2 gyp ERR! node-gyp -v v5.1.0 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute '/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' (1) node-pre-gyp ERR! stack at ChildProcess. (/Users/ahmed/video-source-code-create-nft-collection/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:400:28) node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1058:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5) node-pre-gyp ERR! System Darwin 21.2.0 node-pre-gyp ERR! command "/opt/homebrew/Cellar/node@14/14.18.2/bin/node" "/Users/ahmed/video-source-code-create-nft-collection/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd /Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas node-pre-gyp ERR! node -v v14.18.2 node-pre-gyp ERR! node-pre-gyp -v v1.0.6 node-pre-gyp ERR! not ok Failed to execute '/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' (1) npm WARN [email protected] No repository field.

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] install: node-pre-gyp install --fallback-to-build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /Users/ahmed/.npm/_logs/2021-12-14T00_37_55_725Z-debug.log

Upvotes: 1

Views: 2815

Answers (1)

dragos
dragos

Reputation: 1

before install npm in vs code try:

nvm install

then

npm install

and try change node ver 14 before all of this

Upvotes: -1

Related Questions