执行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

执行NPM报错,踩坑记录_第1张图片

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都要删掉
遇见的问题先记一下后面再加

你可能感兴趣的:(执行NPM报错,踩坑记录)