IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> JavaScript知识库 -> vue项目 安装依赖报错 node-sass报错 -> 正文阅读

[JavaScript知识库]vue项目 安装依赖报错 node-sass报错

node安装错误报错

比较老的项目,需要维护。安装依赖包是一直报这个错, npm intsall 安装依赖一直失败,到网上查是 node-sass 安装的问题。

> core-js@3.6.5 postinstall B:\vue\Code\vue-cars-admin-master\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"


> ejs@2.7.4 postinstall B:\vue\Code\vue-cars-admin-master\node_modules\ejs
> node ./postinstall.js

Thank you for installing EJS: built with the Jake JavaScript build tool (https://jakejs.com/)

[            ......] | postinstall:num2fraction: info lifecycle num2fraction@1.2.2~postinstall: num[            ......] | postinstall:icss-utils: info lifecycle icss-utils@4.1.1~postinstall: icss-ut[            ......] | postinstall:watchpack: info lifecycle watchpack@1.7.4~postinstall: watchpack

> node-sass@4.14.1 postinstall B:\vue\Code\vue-cars-admin-master\node_modules\node-sass
> node scripts/build.js

Building: D:\myEnvironment\nodejs\node.exe B:\vue\Code\vue-cars-admin-master\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 [
gyp verb cli   'D:\\myEnvironment\\nodejs\\node.exe',
gyp verb cli   'B:\\vue\\Code\\vue-cars-admin-master\\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 verb cli ]
gyp info using node-gyp@3.8.0
gyp info using node@12.16.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 (B:\vue\Code\vue-cars-admin-master\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (B:\vue\Code\vue-cars-admin-master\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (B:\vue\Code\vue-cars-admin-master\node_modules\which\which.js:80:29)
gyp verb `which` failed     at B:\vue\Code\vue-cars-admin-master\node_modules\which\which.js:89:16 
gyp verb `which` failed     at B:\vue\Code\vue-cars-admin-master\node_modules\isexe\index.js:42:5  
gyp verb `which` failed     at B:\vue\Code\vue-cars-admin-master\node_modules\isexe\windows.js:36:5gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:166:21)
gyp verb `which` failed  python2 Error: not found: python2
gyp verb `which` failed     at getNotFoundError (B:\vue\Code\vue-cars-admin-master\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (B:\vue\Code\vue-cars-admin-master\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (B:\vue\Code\vue-cars-admin-master\node_modules\which\which.js:80:29)
gyp verb `which` failed     at B:\vue\Code\vue-cars-admin-master\node_modules\which\which.js:89:16 
gyp verb `which` failed     at B:\vue\Code\vue-cars-admin-master\node_modules\isexe\index.js:42:5  
gyp verb `which` failed     at B:\vue\Code\vue-cars-admin-master\node_modules\isexe\windows.js:36:5gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:166:21) {
gyp verb `which` failed   stack: 'Error: not found: python2\n' +
gyp verb `which` failed     '    at getNotFoundError (B:\\vue\\Code\\vue-cars-admin-master\\node_modules\\which\\which.js:13:12)\n' +
gyp verb `which` failed     '    at F (B:\\vue\\Code\\vue-cars-admin-master\\node_modules\\which\\which.js:68:19)\n' +
gyp verb `which` failed     '    at E (B:\\vue\\Code\\vue-cars-admin-master\\node_modules\\which\\which.js:80:29)\n' +
gyp verb `which` failed     '    at B:\\vue\\Code\\vue-cars-admin-master\\node_modules\\which\\which.js:89:16\n' +
gyp verb `which` failed     '    at B:\\vue\\Code\\vue-cars-admin-master\\node_modules\\isexe\\index.js:42:5\n' +
gyp verb `which` failed     '    at B:\\vue\\Code\\vue-cars-admin-master\\node_modules\\isexe\\windows.js:36:5\n' +
gyp verb `which` failed     '    at FSReqCallback.oncomplete (fs.js:166:21)',
gyp verb `which` failed   code: 'ENOENT'
gyp verb `which` failed }
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 (B:\vue\Code\vue-cars-admin-master\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (B:\vue\Code\vue-cars-admin-master\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (B:\vue\Code\vue-cars-admin-master\node_modules\which\which.js:80:29)
gyp verb `which` failed     at B:\vue\Code\vue-cars-admin-master\node_modules\which\which.js:89:16 
gyp verb `which` failed     at B:\vue\Code\vue-cars-admin-master\node_modules\isexe\index.js:42:5  
gyp verb `which` failed     at B:\vue\Code\vue-cars-admin-master\node_modules\isexe\windows.js:36:5gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:166:21)
gyp verb `which` failed  python Error: not found: python
gyp verb `which` failed     at getNotFoundError (B:\vue\Code\vue-cars-admin-master\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (B:\vue\Code\vue-cars-admin-master\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (B:\vue\Code\vue-cars-admin-master\node_modules\which\which.js:80:29)
gyp verb `which` failed     at B:\vue\Code\vue-cars-admin-master\node_modules\which\which.js:89:16
gyp verb `which` failed     at B:\vue\Code\vue-cars-admin-master\node_modules\isexe\index.js:42:5  
gyp verb `which` failed     at B:\vue\Code\vue-cars-admin-master\node_modules\isexe\windows.js:36:5gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:166:21) {
gyp verb `which` failed   stack: 'Error: not found: python\n' +
gyp verb `which` failed     '    at getNotFoundError (B:\\vue\\Code\\vue-cars-admin-master\\node_modules\\which\\which.js:13:12)\n' +
gyp verb `which` failed     '    at F (B:\\vue\\Code\\vue-cars-admin-master\\node_modules\\which\\which.js:68:19)\n' +
gyp verb `which` failed     '    at E (B:\\vue\\Code\\vue-cars-admin-master\\node_modules\\which\\which.js:80:29)\n' +
gyp verb `which` failed     '    at B:\\vue\\Code\\vue-cars-admin-master\\node_modules\\which\\which.js:89:16\n' +
gyp verb `which` failed     '    at B:\\vue\\Code\\vue-cars-admin-master\\node_modules\\isexe\\index.js:42:5\n' +
gyp verb `which` failed     '    at B:\\vue\\Code\\vue-cars-admin-master\\node_modules\\isexe\\windows.js:36:5\n' +
gyp verb `which` failed     '    at FSReqCallback.oncomplete (fs.js:166:21)',
gyp verb `which` failed   code: 'ENOENT'
gyp verb `which` failed }
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 (B:\vue\Code\vue-cars-admin-master\node_modules\node-gyp\lib\configure.js:484:19)
gyp ERR! stack     at PythonFinder.<anonymous> (B:\vue\Code\vue-cars-admin-master\node_modules\node-gyp\lib\configure.js:509:16)
gyp ERR! stack     at callback (B:\vue\Code\vue-cars-admin-master\node_modules\graceful-fs\polyfills.js:295:20)
gyp ERR! stack     at FSReqCallback.oncomplete (fs.js:166:21)
gyp ERR! System Windows_NT 10.0.19041
gyp ERR! command "D:\\myEnvironment\\nodejs\\node.exe" "B:\\vue\\Code\\vue-cars-admin-master\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd B:\vue\Code\vue-cars-admin-master\node_modules\node-sass
gyp ERR! node -v v12.16.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
[            ......] / postinstall: info lifecycle node-sass@4.14.1~postinstall: Failed to exec pos[            ......] / postinstall: info lifecycle node-sass@4.14.1~postinstall: Failed to exec pos[            ......] - postinstall: info lifecycle node-sass@4.14.1~postinstall: Failed to exec pos[            ......] - postinstall: info lifecycle node-sass@4.14.1~postinstall: Failed to exec pos[            ......] - postinstall: info lifecycle node-sass@4.14.1~postinstall: Failed to exec pos[            ......] - postinstall: info lifecycle node-sass@4.14.1~postinstall: Failed to exec posnpm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_mPENDENCY: fsevents@1.2.13 (node_modules\webpack-dev-server\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})        s":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\watchpack-chokidar2\node_modules\fsevents):                s":"win32","arch":"x64"})        
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})                                                                                                                ":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.14.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.14.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

分析一下,这个错误的出现是因为sass安装时获取源的问题,修改sass安装的源。
解决办法:使用taobao的npm

npm config set sass_binary_site=https://npm.taobao.org/mirrors/node-sass

回车后,再输入npm install就完美解决了。

npm install```

  JavaScript知识库 最新文章
ES6的相关知识点
react 函数式组件 & react其他一些总结
Vue基础超详细
前端JS也可以连点成线(Vue中运用 AntVG6)
Vue事件处理的基本使用
Vue后台项目的记录 (一)
前后端分离vue跨域,devServer配置proxy代理
TypeScript
初识vuex
vue项目安装包指令收集
上一篇文章      下一篇文章      查看所有文章
加:2022-04-07 22:34:53  更:2022-04-07 22:35:44 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年11日历 -2024/11/24 2:37:47-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码