首页 > 编程语言 >node_modules/canvas npm ERR! command failed

node_modules/canvas npm ERR! command failed

时间:2022-11-15 12:55:33浏览次数:39  
标签:node npm canvas ERR react gyp my

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template-typescript...

npm ERR! code 1
npm ERR! path /Users/liujianchuan/Tutorial/my-react-project/my-react-app/node_modules/canvas
npm ERR! command failed
npm ERR! command sh -c -- node-gyp rebuild
npm ERR! Package pixman-1 was not found in the pkg-config search path.
npm ERR! Perhaps you should add the directory containing `pixman-1.pc'
npm ERR! to the PKG_CONFIG_PATH environment variable
npm ERR! No package 'pixman-1' found
npm ERR! gyp: Call to 'pkg-config pixman-1 --libs' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
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/liujianchuan/Tutorial/my-react-project/my-react-app/node_modules/node-gyp/lib/configure.js:259:16)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Darwin 21.6.0
npm ERR! gyp ERR! command "/usr/local/bin/node" "/Users/liujianchuan/Tutorial/my-react-project/my-react-app/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /Users/liujianchuan/Tutorial/my-react-project/my-react-app/node_modules/canvas
npm ERR! gyp ERR! node -v v18.12.1
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/liujianchuan/.npm/_logs/2022-11-15T01_46_01_465Z-debug-0.log

Aborting installation.
npm install --no-audit --save --save-exact --loglevel error react react-dom react-scripts cra-template-typescript has failed.

Deleting generated file... package.json
Deleting my-react-app/ from /Users/liujianchuan/Tutorial/my-react-project
Done.
liujianchuan@ZBMac-C02F90L3M-6  ~/Tutorial/my-react-project  node -v  1 ↵  10626  09:47:01
v18.12.1
liujianchuan@ZBMac-C02F90L3M-6  ~/Tutorial/my-react-project  sh -c -- node-gyp rebuild  ✔  10627  09:47:08
rebuild: node-gyp: command not found
liujianchuan@ZBMac-C02F90L3M-6  ~/Tutorial/my-react-project  node -v  127 ↵  10628  09:47:28
v18.12.1
liujianchuan@ZBMac-C02F90L3M-6  ~/Tutorial/my-react-project  node -v  ✔  10629  09:47:30
v18.12.1
liujianchuan@ZBMac-C02F90L3M-6  ~/Tutorial/my-react-project  sudo n  ✔  10629  09:49:08
Password:
installed : v16.14.2 (with npm 8.5.0)
liujianchuan@ZBMac-C02F90L3M-6  ~/Tutorial/my-react-project  node -v  ✔  10630  09:49:38
v16.14.2
liujianchuan@ZBMac-C02F90L3M-6  ~/Tutorial/my-react-project  npx create-react-app my-react-app --template typescript

Creating a new React app in /Users/liujianchuan/Tutorial/my-react-project/my-react-app.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template-typescript...

npm ERR! code 1
npm ERR! path /Users/liujianchuan/Tutorial/my-react-project/my-react-app/node_modules/canvas
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! Package pixman-1 was not found in the pkg-config search path.
npm ERR! Perhaps you should add the directory containing `pixman-1.pc'
npm ERR! to the PKG_CONFIG_PATH environment variable
npm ERR! No package 'pixman-1' found
npm ERR! gyp: Call to 'pkg-config pixman-1 --libs' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
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/liujianchuan/Tutorial/my-react-project/my-react-app/node_modules/node-gyp/lib/configure.js:259:16)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:526:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Darwin 21.6.0
npm ERR! gyp ERR! command "/usr/local/bin/node" "/Users/liujianchuan/Tutorial/my-react-project/my-react-app/node_modules/.bin/node-gyp" "rebuild"

 

 

 

 

 

 


npm ERR! gyp ERR! cwd /Users/liujianchuan/Tutorial/my-react-project/my-react-app/node_modules/canvas
npm ERR! gyp ERR! node -v v16.14.2
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/liujianchuan/.npm/_logs/2022-11-15T02_01_43_860Z-debug-0.log

标签:node,npm,canvas,ERR,react,gyp,my
From: https://www.cnblogs.com/hellolol/p/16892064.html

相关文章

  • vue cli 下载 node_modules
    cd至项目文件根目录npminstall用npm安装有可能会到导致关联失败解决方案yarninstall安装yarnyarn安装第三方库比npm会快一些npminstallyarn-g如果M......
  • Android Canvas 清除背景
    使用canvas.drawColor(Color.TRANSPARENT,PorterDuff.Mode.CLEAR);即可完成清除背景,但是发现Canvas会留下黑色背景,以下提供处理方法//使窗口支持透明度surfaceHol......
  • 一站式解决Node项目中遇到的 诸如sharp Command failed.或Building fresh packages...
    一站式解决Node项目中遇到的诸如sharp:Commandfailed.或Buildingfreshpackages...始终执行问题1.问题的形式形式一:Buildingfreshpackages...1.[-/5]⠐waiti......
  • node的模块讲解
    node的模块划分 内置模块(不需要安装的)http(提供http服务的)fs(fileSystem文件系统)url(url地址)path(路径)event(事件源)net(通信)io(流)... 第三方模块(需要安装)expressmd......
  • NodeJS搭建简易的后台服务(连接MSSQL数据库)
    一、环境搭建去官网NodeJS下载,这个同时还附带好用的包管理器NPM,方便后续下载管理各种包。一路安装完毕后,我们来创建自己的第一个应用。NodeJS是在服务器上执行的JS脚本,......
  • 解决node16版本在启动项目时,项目中node-sass和sass-loader版本不兼容的情况
    1、安装node16版本后,需要对项目中的node-sass和sass-loader进行升级,否则会报如下错误Error:NodeSassdoesnotyetsupportyourcurrentenvironment:Windows64-bit......
  • window下的nvm软件Node Version Manage
    windownvm链接:https://github.com/coreybutler/nvm-windows手动安装链接:https://github.com/coreybutler/nvm-windows/wiki#manual-installationnvm官方仅支持linux和os......
  • Linux配置node环境
    1.下载安装包https://nodejs.org/en/download/releases/官网下载需要的版本,我这里下的16版本mac本通过电脑自带远程传输sftp进行本地上传安装包,window需要自行百度一下......
  • Nodejs:ESModule和commonjs,傻傻分不清
    最近写nodejs脚本的时候遇到了commonjs和ESModule的问题,正好之前用得稀里糊涂的,这次好好学习一下。ESModule导出仅导出namedexports:命名导出,每次可以导出一个或......
  • Nodejs相关ORM框架分析
    概述写这篇blog的原因,想找个node的ORM框架用用,确很难找到一篇对比分析这些ORM框架的文章,唯一找到了一篇,居然是通过star数来论英雄,我觉着很难服众,于是就找几个看看。后来又......