使用npm安装create-react-app时出错 [英] Error installing create-react-app with npm

查看:222
本文介绍了使用npm安装create-react-app时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试全局甚至在项目中安装create-react-app(或nodemon)时,出现以下错误。但是,我可以在全局和本地完全安装其他软件包。我认为这与以下事实有关:create-react-app和nodemon均从终端运行,而不是在项目代码中使用。

When I try to install create-react-app (or nodemon) globally or even within a project, I get the following error. However, I can install other packages perfectly fine both globally and locally. I think it has something to do with the fact that both create-react-app and nodemon are run from the terminal rather than used within a project's code.

我已经尝试重新安装nodejs并以管理员身份打开终端,但这没用。

I have already tried reinstalling nodejs and opening the terminal as administrator, but that did not work.

$ npm i -D nodemon
npm ERR! path C:\Users\Shivang\AppData\Roaming\npm-cache\_cacache\index-v5\78\49\9aac8fdb9b898c6d95e47da44f0425e95568d85f83d82f7bae06293b0a03
npm ERR! code UNKNOWN
npm ERR! errno -4094
npm ERR! syscall open
npm ERR! UNKNOWN: unknown error, open 'C:\Users\Shivang\AppData\Roaming\npm-cache\_cacache\index-v5\78\49\9aac8fdb9b898c6d95e47da44f0425e95568d85f83d82f7bae06293b0a03'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Shivang\AppData\Roaming\npm-cache\_logs\2018-12-22T13_29_35_317Z-debug.log






更新:当我运行npm cache clean --force时,出现以下错误


UPDATE: When I ran npm cache clean --force, I got the following error

$ npm cache clean --force
npm WARN using --force I sure hope you know what you are doing.
npm ERR! path C:\Users\Shivang\AppData\Roaming\npm-cache\_cacache\index-v5\78
npm ERR! code UNKNOWN
npm ERR! errno -4094
npm ERR! syscall unlink
npm ERR! UNKNOWN: unknown error, unlink 'C:\Users\Shivang\AppData\Roaming\npm-cache\_cacache\index-v5\78'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Shivang\AppData\Roaming\npm-cache\_logs\2018-12-22T13_55_42_508Z-debug.log


推荐答案

运行 npm cache clean --force ,然后尝试再次安装

Run npm cache clean --force and then try installing again

这篇关于使用npm安装create-react-app时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆