【发布时间】:2022-01-10 15:50:34
【问题描述】:
我是第一次安装 react。我似乎无法摆脱这些问题。当我运行这些命令时。
npx create-react-app employee
我首先得到“ENolock 这些命令需要现有的锁文件”错误然后我运行
npm audit fix --force
当我现在尝试创建 React 应用程序时,我遇到了这些错误,您可以在下面的代码段中看到我该怎么办?
p.s 我也试过npm cache clean 然后尝试创建反应应用程序
C:\Full stack app\client>npm audit
npm ERR! code ENOLOCK
npm ERR! audit This command requires an existing lockfile.
npm ERR! audit Try creating one first with: npm i --package-lock-only
npm ERR! audit Original error: loadVirtual requires existing shrinkwrap file
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\SENU\AppData\Local\npm-cache\_logs\2021-12-04T15_48_12_673Z-debug.log
C:\Full stack app\client>npx create-react-app employee
Creating a new React app in C:\Full stack app\client\employee.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npm ERR! Cannot read properties of undefined (reading 'isServer')
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\SENU\AppData\Local\npm-cache\_logs\2021-12-04T15_50_22_255Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.
Deleting generated file... package.json
Deleting employee/ from C:\Full stack app\client
Done.
C:\Full stack app\client>
【问题讨论】:
-
Node 和 npm 版本?
标签: node.js reactjs react-native frontend mern