1、错误情况

gyp verb `which` succeeded python C:\Users\Software\Python\Python310\python.EXE
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Users\Software\Python\Python310\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", line 1
gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gyp ERR! stack SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (node:child_process:399:12)
gyp ERR! stack     at ChildProcess.emit (node:events:526:28)
gyp ERR! stack     at maybeClose (node:internal/child_process:1092:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
gyp ERR! System Windows_NT 10.0.22000
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\18084\\Desktop\\phase-3\\fresh-market-master\\fresh-market-master\\生鲜超市\\online-store\\node_modules\\_node-gyp@3.8.0@node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\18084\Desktop\phase-3\fresh-market-master\fresh-market-master\生鲜超市\online-store\node_modules\_node-sass@4.14.1@node-sass
gyp ERR! node -v v16.14.2
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
[npminstall:runscript:error] node-sass@^4.5.2 scripts.postinstall run "node scripts/build.js" error: Error [RunScriptError]: Run "C:\Windows\system32\cmd.exe /d /s /c node scripts/build.js" error, exit code 1at ChildProcess.<anonymous> (C:\Users\18084\AppData\Roaming\npm\node_modules\cnpm\node_modules\runscript\index.js:96:21)at ChildProcess.emit (node:events:526:28)at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) {stdio: [Object],exitcode: 1
}
× Install fail! RunScriptError: post install error, please remove node_modules before retry!
Run "C:\Windows\system32\cmd.exe /d /s /c node scripts/build.js" error, exit code 1
RunScriptError: Run "C:\Windows\system32\cmd.exe /d /s /c node scripts/build.js" error, exit code 1at ChildProcess.<anonymous> (C:\Users\18084\AppData\Roaming\npm\node_modules\cnpm\node_modules\runscript\index.js:96:21)at ChildProcess.emit (node:events:526:28)at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npminstall version: 5.8.0
npminstall args: C:\Program Files\nodejs\node.exe C:\Users\18084\AppData\Roaming\npm\node_modules\cnpm\node_modules\npminstall\bin\install.js --fix-bug-versions --china --userconfig=C:\Users\18084\.cnpmrc --disturl=https://npmmirror.com/mirrors/node --registry=https://registry.npmmirror.com


2、产生原因

创建vue2.x项目时选用手动配置项目依赖时如果CSS样式器选择的是(with node-sass)就会报出上面的错误:

编译失败的原因其大的方向就两点:
①程序本身存在语法错误或语义错误;
②编译环境存在问题导致无法编译(常见的就是缺少相关依赖和插件);

3、解决方案

①.下载安装node.js时最后一定要选择自动安装编译本地模块所需的工具(自己手动下载难度大,建议使用这个方法)

② 上面那个选项说的很明白了如果采用自动安装那么也必然会安装Chocolatey,(那么安装Chocolate是采用了远程脚本的一种方式且会在Windows PowerShell中进行,而使用PowerShell首先必须确保Get-ExecutionPolicy不受限制。(建议使用Bypass绕过该策略来安装或AllSigned安全性更高) 因为windows PowerShell的执行策略默认是禁止运行脚本的所以我们需要修改组策略。

<1>首先运行Get-ExecutionPolicy
<2>如果返回Restricted,则运行Set-ExecutionPolicy AllSigned或Set-ExecutionPolicy Bypass

PS C:\Users\18084> Set-ExecutionPolicy -ExecutionPolicy Bypass
PS C:\Users\18084>  Get-ExecutionPolicy
Bypass
PS C:\Users\18084> Set-ExecutionPolicy -ExecutionPolicy AllSigned
PS C:\Users\18084>  Get-ExecutionPolicy
AllSigned
PS C:\Users\18084>


③ PowerShell 脚本调整脚本的执行策略。比如设置成不会限制脚本执行的 Bypass命令:

Set-ExecutionPolicy -ExecutionPolicy Bypass

node:注意,设置脚本的执行策略需要管理员权限,因此你需要以管理员权限启动 PowerShell ,然后执行上面的命令。

必须执行策略允许运行脚本才可以执行node.js的自动安装不然会安装失败

4、成功之后,安装vue的脚手架,执行命令:

npm install

出现报错:

core-js@2.6.12: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.

方法:

npm install --save core-js@^3

【Python】创建Vue项目报错python.EXE -c import sys; print “%s.%s.%s“ % sys.version_info[:3];相关推荐

  1. 创建Vue项目报错python.EXE -c import sys; print “%s.%s.%s“ % sys.version_info[:3]

    目录 情景再现 产生原因 分析问题 解决方案 情景再现 产生原因 创建vue2.x项目时选用手动配置项目依赖时如果CSS样式器选择的是(with node-sass)就会报出上面的错误 分析问题 首先 ...

  2. 创建 vue 项目 报错:command failed: npm install --loglevel error --legacy-peer-deps

    用 vue-cli 创建vue项目时,报了个错: command failed: npm install --loglevel error --legacy-peer-deps,.然后看报错信息,装了 ...

  3. 创建Vue项目报错:~/.vuerc may be outdated. Please delete it and re-run vue-cli in manual mode.

    将Vue Cli版本降为了3.x版本之后,再次创建新的Vue项目,报以下错误: 找到~/.vuerc文件,将其删除即可 C:\Users\Administrator

  4. 创建Vue项目报错:ERROR ~/.vuerc may be outdated. Please delete it and re-run vue-cli in manual mode.

    将Vue Cli版本降为了3.x版本之后,再次创建新的Vue项目,报以下错误: ERROR ~/.vuerc may be outdated. Please delete it and re-run ...

  5. 创建Scrapy项目报错 UnicodeDecodeError: 'ascii' codec can't decode byte 0xa3 in position 19

    刚安装好,创建Scrapy 项目报错: D:\py_workspace\test_scrapy>scrapy startobject a Traceback (most recent call ...

  6. IDEA创建maven项目报错解决:Failed to create a Maven project: 'C:/Users/../IdeaProjects/../pom.xml' already e

    此文首发于我的个人博客:IDEA创建maven项目报错解决 Failed to create a Maven project 'C:/Users/-/IdeaProjects/-/pom.xml' a ...

  7. Vue项目 报错TypeError [ERR INVALID ARG TYPE]: The “path“ argument must be of type string

    # Vue项目 报错TypeError [ERR INVALID ARG TYPE]: The "path" argument must be of type string 卡了半 ...

  8. Vue项目报错:This relative module was not found

    Vue项目报错:This relative module was not found 问题如下 解决办法 出现这种错误检查自己的路径问题 我已解决 "./ ":代表当前所在的目录. ...

  9. 解决Vue项目报错:Expected indentation of 2 spaces but found 4. eslint(indent) [8, 1]的方法

    解决Vue项目报错:Expected indentation of 2 spaces but found 4. eslint(indent) [8, 1]的方法 报错如下 问题分析 明显从图中可以以看 ...

最新文章

  1. Cocos2d-x3.0 TestCPP文件夹笔记
  2. 字节跳动最新开源!沈阳java培训哪个好
  3. 掌握 Ajax,第 8 部分: 在请求和响应中使用 XML
  4. arm 驱动基础:查询方式的按键驱动程序
  5. Git使用教程:真正手把手教你使用git!
  6. 算法之美 : 位运算
  7. 查看函数库.a函数符号信息
  8. mysql set substring_MySQL substring()函数
  9. iphonex价格_iPhone X竟然可以换LCD屏幕,价格只要一半
  10. Android Studio 主题、字体大小的设置
  11. 衬线字体与无衬线字体
  12. input onchange事件不触发 oninput onpropertychange onchange 实时监听
  13. 鼠标右键菜单打开慢的解决方式
  14. AS179-92LF pHEMT GaAs FET单刀双掷(SPDT)开关SKYWORKS
  15. Pro Tools 贴士- 使用Snapper快速试听和导入音频素材
  16. axure如何页面滑动时广告位上移_Axure实现滚动广告效果
  17. 用ThoughtWorks.QRCode生成二维码时出现“索引超出了数组界限”的错误
  18. echarts世界地图中的国家名称显示中文
  19. python 全栈开发,Day43(python全栈11期月考题)
  20. SpringBoot读取Word文档

热门文章

  1. 用JavaScript实现时间戳转为日期格式
  2. Drone配合Gogs实现持续集成
  3. php面向对象(OOP)—什么是面向对象
  4. php手机验证登录,php如何实现手机验证
  5. 云计算机怎么打游戏,云即玩游戏盒怎么用 云即玩游戏盒电脑版使用教程
  6. java 静态调用非静态方法_java中静态方法中调用非静态方法的详解
  7. 【详细】芯片设计全流程(包括每个流程需要用到的工具以及需要参与的工作人员)
  8. 数字逻辑·数制转换、编码方法
  9. android 点击图片弹出对话框,android studio怎样弹出对话框--实际案例?
  10. 本人32岁,转行做运维经验分享