npm ERR! enoent ENOENT: no such file or directory, rename

Posted 柳鲲鹏

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了npm ERR! enoent ENOENT: no such file or directory, rename相关的知识,希望对你有一定的参考价值。

  • 具体错误
$ sudo npm install -g npm
▌ ╢░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
WARN engine npm@9.2.0: wanted: "node":"^14.17.0 || ^16.13.0 || >=18.0.0" (current: "node":"8.10.0","npm":"3.5.2")
WARN engine npm@9.2.0: wanted: "node":"^14.17.0 || ^16.13.0 || >=18.0.0" (currnpm WARN install:@colors/colors@1.5.0 ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/.staging/@colors/colors-c8990a6d' -> '/usr/local/lib/node_modules/npm/node_modules/@colors/colors'
/usr/local/lib
└── (empty)

npm ERR! Linux 5.4.0-84-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "npm"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2
npm ERR! path /usr/local/lib/node_modules/.staging/@gar/promisify-ebaab35a
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename

npm ERR! enoent ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/.staging/@gar/promisify-ebaab35a' -> '/usr/local/lib/node_modules/npm/node_modules/@gar/promisify'
npm ERR! enoent ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/.staging/@gar/promisify-ebaab35a' -> '/usr/local/lib/node_modules/npm/node_modules/@gar/promisify'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! Please include the following file with any support request:
npm ERR!     /home/tsit/npm-debug.log
npm ERR! code 1
  • 解决办法

最近跟元心合作,他们给出了一个不可思议的办法。

元心系统SyberH开发环境搭建_柳鲲鹏的博客-CSDN博客

sudo apt install -y aptitude
 
sudo aptitude install npm
# 先n再y
 
sudo npm install -g yarn
sudo npm install -g n
sudo n v10.16.2

 

以上是关于npm ERR! enoent ENOENT: no such file or directory, rename的主要内容,如果未能解决你的问题,请参考以下文章

npm ERR! enoent ENOENT: no such file or directory, rename

cnmp安装失败,报错npm ERR! enoent ENOENT: no such file or directory,

npm 启动错误并出现 ERR!代码 ENOENT,系统调用打开

docker-compose 无法以 npm ERR 启动! enoent ENOENT:没有这样的文件或目录,打开'/usr/src/app/package.json'

`yo angular` 给出错误:npm ERR!代码 ENOENT npm 错误! errno 34(是的,我已经清理了缓存并设置了 .npmignore)

运行 npm start 时出现“index.js not found”,错误!代码 ELIFECYCLE 和 ENOENT