安装nodejs报错:Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force

  1. 安装nodejs版本为node-v16.16.0-x64.msi,安装完成后执行node -v命令老是提示警告命令: npm WARN config global --global, --local are deprecated. Use --location=global instead.

  2. 根据百度提示npm 没有同步升级到对应版本,所以出现 WARN

  3. 安装npm-windows-upgrade: npm install -g npm-windows-upgrade

  4. 执行npm-windows-upgrade命令,提示:Scripts cannot be executed on this system;此时需要打开Windows管理员下的PowerShell窗口执行:Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force或Set-ExecutionPolicy Unrestricted -Scope CurrentUser,然后再执行npm-windows-upgrade,选择最新的npm进行安装即可.

  5. 使用cnpm,首先cmd全局安装npm install -g cnpm --registry=http://registry.npmmirror.com,然后就可以cnpm了.

posted @   文采杰出  阅读(527)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)
点击右上角即可分享
微信分享提示