我正在运行npm uninstall create-react-app
,它返回
npm WARN saveError ENOENT: no such file or directory, open '/Users/me/Documents/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/me/Documents/package.json'
npm WARN Documents No description
npm WARN Documents No repository field.
npm WARN Documents No README data
npm WARN Documents No license field.
我想更新我的create-react-app版本,但显然他们不再支持全局安装。当我第一次安装CRA时(一段时间之前),它是全局安装的。现在,我正在尝试更新它,但遇到问题。我运行了npm update create-react-app
,但是我的终端只是闪烁了一秒钟就返回了提示符。因此,我决定彻底卸载create-react-app
并重新安装它,但现在我遇到了上述警告/问题。你有什么想法出了什么问题吗?
编辑:
当我运行
npm i create-react-app
时,它也会抛出上述的WARN
,但它还说+ create-react-app@3.3.0 // <---
added 1 package and audited 578 packages in 1.787s
然而,当我再次运行命令 create-react-app --version
时,它显示为3.2.0
编辑2:
我已经多次运行了npm i -g create-react-app
,但是它会抛出以下错误:
Michaels-MacBook-Pro:Documents me$ npm i -g create-react-app
npm ERR! code EEXIST
npm ERR! syscall symlink
npm ERR! path ../lib/node_modules/create-react-app/index.js
npm ERR! dest /usr/local/bin/create-react-app
npm ERR! errno -17
npm ERR! EEXIST: file already exists, symlink '../lib/node_modules/create-react-app/index.js' -> '/usr/local/bin/create-react-app'
npm ERR! File exists: /usr/local/bin/create-react-app
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/me/.npm/_logs/2019-12-23T08_07_29_158Z-debug.log
up to date in 0.031s
。然而,如果我紧接着运行create-react-app --version
,它会显示3.2.0
。 - Mike K