Node.js一些报错的解决方案

2023-11-04

安装

https://blog.csdn.net/qq_48485223/article/details/122709354

报错1:查询版本

$ npm -v

npm WARN logfile could not create logs-dir: Error: EPERM: operation not permitted, mkdir ‘D:\Node.js\node_cache_logs’
npm WARN logfile could not be created: Error: ENOENT: no such file or directory, open ‘D:\Node.js\node_cache_logs\2022-09-12T01_48_51_164Z-debug-0.log’
npm WARN logfile could not create logs-dir: Error: EPERM: operation not permitted, mkdir ‘D:\Node.js\node_cache_logs’
npm WARN logfile could not be created: Error: ENOENT: no such file or directory, open ‘D:\Node.js\node_cache_logs\2022-09-12T01_48_52_183Z-debug-0.log’
8.15.0

解决方案:
Node.js安装文件夹>>右键-属性>>勾选完全控制,如果无法勾选,对目录下的node_cache与node_global文件夹进行勾选。

在这里插入图片描述

报错2:全局安装镜像

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

npm ERR! code EPERM
npm ERR! syscall mkdir
npm ERR! path D:\Software\Node.js\node_global\node_modules
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, mkdir ‘D:\Software\Node.js\node_global\node_modules’
npm ERR! [Error: EPERM: operation not permitted, mkdir ‘D:\Software\Node.js\node_global\node_modules’] {
npm ERR! errno: -4048,
npm ERR! code: ‘EPERM’,
npm ERR! syscall: ‘mkdir’,
npm ERR! path: ‘D:\Software\Node.js\node_global\node_modules’
npm ERR! }
npm ERR!
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.

npm ERR! A complete log of this run can be found in:
npm ERR! D:\Software\Node.js\node_cache_logs\2022-09-12T02_47_24_738Z-debug-0.log

解决方案:
第一步,删除C:\Users目录下.npmrc文件;
第二步,输入命令npm cache clean --force
重新安装cnpm,输入命令cnpm -v显示版本号即安装成功,如下:
在这里插入图片描述

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Node.js一些报错的解决方案 的相关文章

随机推荐

  • Unity制作地震防空知识视频讲解程序

    https www bilibili com video BV1Hy4y1S78b 定制访问 https item taobao com item htm spm a2oq0 12575281 0 0 50111debJplIKu ft t
  • 技术人再不懂区块链,你就OUT了?漫画版

    这几天区块链技术无意中被徐小平 忽悠 的更加红火了 蹭着区块链的大火 今天小编就再给大家普及一下区块链相关知识 一幅漫画秒懂 区块链 区块链技术是指一种全民参与记账的方式 所有的系统背后都有一个数据库 你可以把数据库看成是一个大账本 目前是
  • 【MATLAB第60期】【更新中】基于MATLAB的ARMAX具有外生回归因子的移动平均自回归模型

    MATLAB第60期 更新中 基于MATLAB的ARMAX具有外生回归因子的移动平均自回归模型 版本更新 2023 7 29版本 1 增加自定义参数 方便直接套数据运行 pre num 3 预采样数据个数 learn pr 0 85 训练数
  • 【Antlr】WHITESPACE is not a recognized channel name

    1 背景 antlr4 权威指南中的文件 第十二章 Simple statically typed programming language with functions and variables taken from Language
  • 51单片机 并行I/O端口介绍

    在51单片机中 共有32只I O引脚 分属于4个端口 P0 P3 端口的功能介绍 1 可作为并行I O输入通道 例如按键开关连接通路 图中P1端口的作用便是作为并行I O输入通道 2 可作为并行I O输出通道 例如 数码显示器 图中P2端口
  • 重写equals()方法

    1 如果想把持久类的实例放入set中 多值关联时 1对多 建议实现equals和hashcode2 想重用托管实例时 也要实现equals和hashcode 3 多个字段组合作为联合主键 必须实现equals和hashcode方法 equa
  • Pycharm安装opencv的几种办法(windows下)

    Pycharm安装opencv的几种方法 之前在默认环境中用pip安装过一次opencv 当时就是参考别人方法弄 稀里糊涂的 然后今天想在自己别的环境下 tensorflow 下安装终于弄懂了一些 暂时发现了几种安装的方法 特此记录下 方法
  • 基于XGBoost-LSTM的天然气价格预测研究(Python代码实现)

    个人主页 研学社的博客 欢迎来到本博客 博主优势 博客内容尽量做到思维缜密 逻辑清晰 为了方便读者 座右铭 行百里者 半于九十 本文目录如下 目录 1 概述 2 运行结果 3 参考文献 4 Python代码实现 1 概述 预测成本模型是开发
  • 调试最长的一帧(第八天)

    先看看总体进度 先获取所有的图形上下文 然后进行checkEvents 请求分发消息并通过takeEvents 获取交互事件 再交由GUIEventHandler处理交互事件 中间的步骤 在checkeEvents里面 消息分发函数 消息处
  • java.lang.IllegalThreadStateException异常原因解析

    同一个Thread不能重复调用start方法 要 implements Runnable 通过使用匿名对象 如new Thread new MyThread start 可多次调用 public class test public stat
  • IOS自动打包

    打包过程 xcodebuild负责将工程源文件编译成xxx app xcrun负责给xxx app 签名并 打包成xxx ipa 第一步清理 xcodebuild clean 第二步编译 xcodebuild 第三步打包 xcrun sdk
  • ECC椭圆曲线加解密原理详解(配图)

    ECC椭圆曲线加解密原理详解 配图 本文主要参照 ECC加密算法入门介绍及 ECC椭圆曲线详解 有具体实例 前言 椭圆曲线 ECC 加密原理跟RSA加解密原理比起来 可真是晦涩难懂 拜读了Kalafinaian的文章 ECC椭圆曲线详解 有
  • Docker进入容器命令

    docker exec it 容器名称 bash 输入 exit 退出容器
  • No module named 'tensorflow.contrib'

    命令行报错如下 import tensorflow contrib slim as slim ModuleNotFoundError No module named tensorflow contrib tensorflow 2 0以后没有
  • (Struts2学习篇) Struts2数据校验之一

    数据校验的意义 WEB数据收集的复杂性 客户数据输入的误操作 其他恶意攻击 struts2数据校验的方法 客户端校验和服务端校验 客户端校验是指 在HTML画面上自动生成JavaScript校验代码 在用户提交到服务器之前在客户端浏览器中进
  • jq校验复选框是否选择了

    jq校验复选框是否选择了 var arr sup input checkbox name custom brand ids checked each function i arr sup i this val if arr sup leng
  • remote: Support for password authentication was removed on August 13, 2021. Please use a personal ac

    报错 remote Support for password authentication was removed on August 13 2021 Please use a personal access token instead r
  • 安装Ubuntu20.04后时间不准

    安装Ubuntu20 04后时间不准 买了一台瘦客户机 原先是安装Windows操作系统的 后面安装Ubuntu20 04后导致时间一直有问题 不准 解决办法 1 安装 ntpdate sudo apt get install ntpdat
  • 超硬核!程序员10种副业赚钱之道,实现月收入增加20k!

    大家好 我是良许 经常有小伙伴问我说 良许 你的副业搞得那么溜 能不能给我们介绍一些可操作性的副业 让我们在让我们在工作之余能有另外一份收入 为了响应大家的需求 本文我就整理了一些我所知道的适合程序员的副业 向大家做一个分享 这些副业 每个
  • Node.js一些报错的解决方案

    安装 https blog csdn net qq 48485223 article details 122709354 报错1 查询版本 npm v npm WARN logfile could not create logs dir E