【发布时间】:2021-09-05 12:46:30
【问题描述】:
我第一次尝试在我的本地机器上创建一个 React 应用程序。我已经使用“npm i -g create-react-app”在全局范围内成功安装了“create-react-app”安装后,当我尝试使用“create-react-app”创建一个反应应用程序时,它会创建应用程序的文件夹里面只有两个文件,分别是the items within the created folder 但是终端显示这个错误:
Error: Cannot find module 'cra-template/package.json'
Require stack:
- C:\Users\East-Sound\Desktop\node_modules\react-scripts\scripts\init.js
- C:\Users\East-Sound\Desktop\contactsudacity\[eval]
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
at Function.resolve (internal/modules/cjs/helpers.js:98:19)
at module.exports (C:\Users\East-Sound\Desktop\node_modules\react-scripts\sc
ripts\init.js:117:13)
at [eval]:3:14
at Script.runInThisContext (vm.js:134:12)
at Object.runInThisContext (vm.js:310:38)
at internal/process/execution.js:81:19
at [eval]-wrapper:6:22
at evalScript (internal/process/execution.js:80:60)
at internal/main/eval_string.js:27:3 {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\East-Sound\\Desktop\\node_modules\\react-scripts\\scripts\\init.
js',
'C:\\Users\\East-Sound\\Desktop\\contactsudacity\\[eval]'
]
}
Aborting installation.
node has failed.
Deleting generated file... package.json
Deleting generated file... yarn.lock
Done.
我该怎么办?
【问题讨论】:
-
你安装了node.js吗?