栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

mac系统:记录一次启动vue报错node

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

mac系统:记录一次启动vue报错node

如果提示是node_gyp报错,找不到python,可能是我们的python环境美配置好

报错信息:

Error: Can't find Python executable "python", you can set the PYTHON env variable

解决方案

//安装gyp
npm install -g node-gyp
//配置依赖
npm config set python python2.7
npm config set msvs_version 2015

遇到问题访问https://github.com/nodejs/node-gyp

配置python环境变量后,报错信息改变

Command "/Library/Frameworks/Python.framework/Versions/3.5/bin/python3 -u -c "import setuptools

这个先不管,这时候看到package.json里依赖的node_sass版本是6.0.1,于是运行npm install node-sass@6.0.1

依旧有node-gyp报错,但是看到有另一个信息

node-sass@6.0.1 postinstall: `node scripts/build.js`

于是尝试

cnpm uninstall node-sass (如果提示cnpm 命令不存在,先换源:npm set registry https://registry.npm.taobao.org/ 再下载安装:npm install -g cnpm --registry=https://registry.npm.taobao.org )

cnpm install node-sass@4.14.1

最后nom install

然后就输入 npm run serve / npm run dev 运行

到现在依旧不明白项目为什么能起来和为什么不能起来,玄学大法好

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/950075.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号