我在 Windows (WSL) 上使用 Linux。 当我尝试使用 create-react-app 搭建一个项目时,我收到了这条消息:
error An unexpected error occurred: "ENOENT: no such file or directory, lstat '/home/sashacode/.cache/yarn/v4/npm-table-5.2.3-cde0cc6eb06751c009efab27e8c820ca5b67b7f2/node_modules/table/README.md'".
info If you think this is a bug, please open a bug report with the information provided in "/mnt/c/Users/PC2/Apps/react_projects/new_world/yarn-error.log".
信息访问link添加有关此命令的文档。
Aborting installation.
yarnpkg add --exact react react-dom react-scripts --cwd /mnt/c/Users/PC2/Apps/react_projects/new_world has failed.
正在删除生成的文件... node_modules 删除生成的文件... package.json 删除生成的文件... yarn.lock 完成。
不知道怎么回事。有帮助吗?
最佳答案
更新node js到新版本
然后再次运行 create-react-app
这应该可以解决您的问题
关于node.js - 无法使用 create-react-app 生成项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56913314/