执行NPM报错,踩坑记录

cmd窗口 使用管理员打开 不然会出现权限错误

npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).

重新检查VUE安装过程
cnpm 或者npm都不行

npm install --registry=https://registry.npm.taobao.org -g

执行依赖下载执行完成之后如果cnpm run报错
查看npm配置

#npm config list

直接干掉淘宝的镜像

npm config rm registry

执行

npm install

在这里插入图片描述

Error: Can’t find Python executable “python”, you can set the PYTHON env variable.

出现找不到Python啥的执行下面两条命令安装

npm install --global --production windows-build-tools
npm install --global node-gyp

出现这个玩意

 gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (D:\*****.js:345:16)
gyp ERR! stack     at ChildProcess.emit (events.js:310:20)

执行安装

npm install -g node-gyp

cross-env不是内部或外部命令,也不是可运行的程序。

npm install -g cross-env

Visual Studio “另一个安装程序已开始运行。请先等它完成,然后再重试”和“正在进行其他安装,请稍后重试…”
打开你的任务管理器 找到叫这个名字的都给结束掉再装就可以了
每次install的时候
文件夹中的node_modules文件和package-lock.json都要删掉
遇见的问题先记一下后面再加

  MSBUILD : error MSB3428: 未能加载 Visual C++ 组件“VCBuild.exe”。要解决此问题,1) 安装 .NET Framework 2.0 SDK;2) 安 装 Microsoft Visual S
tudio 2005;或 3) 如果将该组件安装到了其他位置,请将其位置添加到系统路径中。 [D:\work\project\lunengWeb\node_modules\node-sass\build\binding.sln]

错误原因:缺少windows构建插件

解决方法:在命令行工具中运行:npm install –global –production windows-build-tools (全局安装windows构建工具)

注意:一定要使用管理员打开命令才有权限构建工具

  • 4
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值