站内搜索:
首页 >> 前端 >> 内容
npmERR!enoentThisisrelatedtonpmnotbeingabletofindafile.问题解决办法

时间:2018/5/9 15:07:26

一、问题描述

运行sudo npm install color-name出现如下错误:

npm ERR! path /root/blog/node_modules/color-name

npm ERR! code ENOENT

npm ERR! errno -2

npm ERR! syscall access

npm ERR! enoent ENOENT: no such file or directory, access '/root/blog/node_modules/color-name'

npm ERR! enoent This is related to npm not being able to find a file.

npm ERR! enoent

npm ERR! A complete log of this run can be found in:

npm ERR! /root/.npm/_logs/2018-05-06T14_39_48_918Z-debug.log

二、解决

1. sudo npm install -g color-name --unsafe-perm=true

2.若方法一无效,将no such file or directory,access中指明的文件路径中的node_modules删除:

rm -r node_modules

然后再重新npm install 安装

  • 上一篇:移动端tab栏中嵌套轮播图无法实现轮播效果的问题及解决办法
  • 下一篇:文章浏览计数效果代码实现
  • 返回顶部