报错完整信息如下:

error D:\xxx\xxx\node_modules\node-sass: Command failed.
Exit code: 1
Command: node scripts/build.js
Arguments:
Directory: D:\xxx\xxx\node_modules\node-sass
Output:
Binary found at D:\software\nodesass\win32-x64-72_binding.node
Testing binary
Binary has a problem: Error: The module '\\?\D:\software\nodesass\win32-x64-72_binding.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 72. This version of Node.js requires
NODE_MODULE_VERSION 64. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).at Object.Module._extensions..node (internal/modules/cjs/loader.js:717:18)at Module.load (internal/modules/cjs/loader.js:598:32)at tryModuleLoad (internal/modules/cjs/loader.js:537:12)at Function.Module._load (internal/modules/cjs/loader.js:529:3)at Module.require (internal/modules/cjs/loader.js:636:17)at require (internal/modules/cjs/helpers.js:20:18)at module.exports (D:\xxx\xxx\node_modules\node-sass\lib\binding.js:19:10)at Object.<anonymous> (D:\xxx\xxx\node_modules\node-sass\lib\index.js:14:35)at Module._compile (internal/modules/cjs/loader.js:688:30)at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
Building the binary locally
Building: C:\Program Files\nodejs\node.exe D:\xxx\xxx\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 [ 'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli   'D:\\xxx\\xxx\\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 node-gyp@3.8.0
gyp info using node@10.14.1 | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
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 (D:\xxx\xxx\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (D:\xxx\xxx\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (D:\xxx\xxx\node_modules\which\which.js:80:29)
gyp verb `which` failed     at D:\xxx\xxx\node_modules\which\which.js:89:16
gyp verb `which` failed     at D:\xxx\xxx\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at D:\xxx\xxx\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:154:21)
gyp verb `which` failed  python2 { Error: not found: python2
gyp verb `which` failed     at getNotFoundError (D:\xxx\xxx\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (D:\xxx\xxx\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (D:\xxx\xxx\node_modules\which\which.js:80:29)
gyp verb `which` failed     at D:\xxx\xxx\node_modules\which\which.js:89:16
gyp verb `which` failed     at D:\xxx\xxx\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at D:\xxx\xxx\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:154:21)
gyp verb `which` failed   stack:
gyp verb `which` failed    'Error: not found: python2\n    at getNotFoundError (D:\\xxx\\xxx\\node_modules\\which\\which.js:13:12)\n    at F (D:\\xxx\\xxx\\node_modules\\which\\which.js:68:19)\n    at E (D:\\xxx\\xxx\\node_modules\\which\\which.js:80:29)\n    at D:\\xxx\\xxx\\node_modules\\which\\which.js:89:16\n    at D:\\xxx\\xxx\\node_modules\\isexe\\index.js:42:5\n    at D:\\xxx\\xxx\\node_modules\\isexe\\windows.js:36:5\n    at FSReqWrap.oncomplete (fs.js:154:21)',
gyp verb `which` failed   code: 'ENOENT' }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` failed Error: not found: python
gyp verb `which` failed     at getNotFoundError (D:\xxx\xxx\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (D:\xxx\xxx\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (D:\xxx\xxx\node_modules\which\which.js:80:29)
gyp verb `which` failed     at D:\xxx\xxx\node_modules\which\which.js:89:16
gyp verb `which` failed     at D:\xxx\xxx\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at D:\xxx\xxx\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:154:21)
gyp verb `which` failed  python { Error: not found: python
gyp verb `which` failed     at getNotFoundError (D:\xxx\xxx\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (D:\xxx\xxx\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (D:\xxx\xxx\node_modules\which\which.js:80:29)
gyp verb `which` failed     at D:\xxx\xxx\node_modules\which\which.js:89:16
gyp verb `which` failed     at D:\xxx\xxx\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at D:\xxx\xxx\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:154:21)
gyp verb `which` failed   stack:
gyp verb `which` failed    'Error: not found: python\n    at getNotFoundError (D:\\xxx\\xxx\\node_modules\\which\\which.js:13:12)\n    at F (D:\\xxx\\xxx\\node_modules\\which\\which.js:68:19)\n    at E (D:\\xxx\\xxx\\node_modules\\which\\which.js:80:29)\n    at D:\\xxx\\xxx\\node_modules\\which\\which.js:89:16\n    at D:\\xxx\\xxx\\node_modules\\isexe\\index.js:42:5\n    at D:\\xxx\\xxx\\node_modules\\isexe\\windows.js:36:5\n    at FSReqWrap.oncomplete (fs.js:154:21)',
gyp verb `which` failed   code: 'ENOENT' }
gyp verb could not find "python". checking python launcher
gyp verb could not find "python". guessing location
gyp verb ensuring that file exists: C:\Python27\python.exe
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (D:\xxx\xxx\node_modules\node-gyp\lib\configure.js:484:19)
gyp ERR! stack     at PythonFinder.<anonymous> (D:\xxx\xxx\node_modules\node-gyp\lib\configure.js:509:16)
gyp ERR! stack     at D:\xxx\xxx\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:154:21)
gyp ERR! System Windows_NT 10.0.19042
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\xxx\\xxx\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd D:\xxx\xxx\node_modules\node-sass
gyp ERR! node -v v16.13.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

上面报错是因为node版本与nodesass版本不匹配导致的,gyp ERR! node -v v16.13.0中显示出来。
最好的解决方法是在网上搜一下nodesass版本匹配的node版本,比如在package.json里面查看nodesass版本是4.14.0,在网上搜索与之匹配的node版本是14.18.1,而不是16.13.0
然后把尝试用nvm更改node版本,改不掉的话,就直接卸载node版本,下载所需的node版本:查看这里

参考链接:
https://blog.csdn.net/suhanyujie/article/details/119942067
https://www.cnblogs.com/huasonglin/p/14777752.html

npm install安装失败 error D:\xxx\xxx\node_modules\node-sass: Command failed. Exit code: 1相关推荐

  1. 使用 yarn 安装时,报错node_modules\node sass:Command failed.

    npm install -g mirror-config-china --registry=http://registry.npm.taobao.org npm install node-sass y ...

  2. npm install安装失败,报错记录之The operation was rejected by your operating system. node-sass无法安装,且禁用淘宝镜像

    因为公司电脑都由管理员管控,使用自己的账号是无法执行一些需要管理员权限的命令,所以在刚到公司时,使用管理员账号安装了node,配置了node缓存目录node_cache.node_global,以及设 ...

  3. vue项目中npm install安装失败,万能解决方法

    vue项目中npm install安装失败,万能解决方法,即更换淘宝镜像,再执行npm install. 具体如下: npm config set registry https://registry. ...

  4. error C:\Users\HP\Desktop\VueProject\vue_cli\node_modules\node-sass: Command failed.Exit code: 1

    vue-cli脚手架搭建Vue项目因安装node-sass报错 error C:\Users\HP\Desktop\VueProject\vue_cli\node_modules\node-sass: ...

  5. npm install安装失败,报错记录之The operation was rejected by your operating system.

    今天在执行npm install的时候一直报如下错误: npm ERR! code EPERM npm ERR! syscall rename npm ERR! path F:\Demo Practi ...

  6. electron demo项目npm install安装失败解决办法

    electron官网提供的demo项目,在npm install 的时候总是报错显示安装失败, 解决办法:FQ即可成功安装. 转载于:https://www.cnblogs.com/beileixin ...

  7. npm install安装失败解决方法

    前言 Win7系统,首先安装了node,然后在vscode里面执行安装npm时报了很多错误,发现巨坑啊(公司电脑安装时,时间长了,也没发现此坑,由于现在冠状病毒疫情的影响,需要在家办公,因此在家里的电 ...

  8. node-sass安装失败 error D:\xxx\xxx\node_modules\node-sass: Command failed.(window + mac M1 pro)

    error D:\xxx\xxx\node_modules\node-sass: Command failed. 导言:运行老项目的时候经常遇到node-sass安装不下来的问题,百度搜索更是千篇一律 ...

  9. node-sass安装失败 error D:\xxx\xxx\node_modules\node-sass: Command failed.

    node-sass安装失败 error D:\xxx\xxx\node_modules\node-sass: Command failed.(window + mac M1 pro) error D: ...

最新文章

  1. IT职场人生系列之二十一:如何学习新语言(一)
  2. java 注解妙用_框架开发之Java注解的妙用
  3. BEGINNING SHAREPOINT#174; 2013 DEVELOPMENT 第9章节--client对象模型和REST APIs概览 client对象模型API范围...
  4. .NET Core用数据库做配置中心加载Configuration
  5. Codeforces Round #579 (Div. 3) F1. Complete the Projects (easy version) 排序 + 贪心
  6. mysql的int多少溢出_mysql 整型(int)数字溢出在程序和数据库设计中的考虑
  7. MATLAB目标检测恒虚警技术,一种自适应的恒虚警率目标检测方法
  8. python是什么意思-python是什么意思
  9. Ka的回溯编程练习 Part4|分配工作与选书
  10. linux内存源码分析 - 内存回收(整体流程)
  11. mysql删除源码_mysql关于删除的命令实例源码删除数据库数据表等
  12. gps面积测量仪手机版下载安装_gps面积测量仪手机版下载-GPS距离面积测量仪 安卓版v3.5.7-PC6安卓网...
  13. bugku misc-旋转跳跃
  14. 积分商城有哪些基本的功能呢?
  15. 微信开发者工具调试公众号网页提示: 未绑定为公众号的网页开发者
  16. 08 获取器 withAttr、多连缀、whereRaw、事务、数据集《ThinkPHP6 入门到电商实战》
  17. 时钟页面置换算法c语言,clock置换算法例题(改进clock置换算法例题讲解)
  18. 2017acl---An Unsupervised Neural Attention Model for Aspect Extraction笔记
  19. 哈工大c语言第四版pdf,哈工大C语言讲义 指针.pdf
  20. 虚拟主机环境WinWebMail邮件系统的常见问题处理

热门文章

  1. Access2013 Mssql2012 数据库连接字符串
  2. 学校计算机网速被限制,学校的限制网速的行为是不是违法了?
  3. DisplayPort--Link training之Clock Recovery (CR)
  4. 联和创“芯”,广东联通积极打造物联网生态圈
  5. Dev-C++使用to_string()函数报错“[Error] ‘to_string‘ was not declared in this scope”原因及解决方案
  6. 解决IDEA里提示Spring Configuration Check “Unmapped Spring configuration files found.的问题
  7. python 变量命名规范
  8. 窄带物联网推广提速 概念股望掀产业革命
  9. Java代码实现单元测试
  10. window.showModalDialog()用法