我无法创建新的react应用程序。到目前为止,它工作得很好,但今天我不得不安装yarn,因为当我试图创建一个新的react应用程序时,我会得到这个错误:
➜ workspace npx create-react-app storybook-tutorial
Creating a new React app in /home/ficho/workspace/storybook-tutorial.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
yarn add v1.22.10
[1/4] Resolving packages...
warning react-scripts > babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
warning react-scripts > workbox-webpack-plugin > workbox-build > @hapi/joi@15.1.1: Switch to 'npm install joi'
warning react-scripts > workbox-webpack-plugin > workbox-build > rollup-plugin-babel@4.4.0: This package has been deprecated and is no
longer maintained. Please use @rollup/plugin-babel.
warning react-scripts > jest > @jest/core > jest-config > jest-environment-jsdom > jsdom > request-promise-native@1.0.9:
request-promise-native has been deprecated because it extends the now
deprecated request package, see
https://github.com/request/request/issues/3142
warning react-scripts > jest > @jest/core > jest-config > jest-environment-jsdom > jsdom > request@2.88.2: request has been
deprecated, see https://github.com/request/request/issues/3142
[2/4] Fetching packages...
info fsevents@1.2.12: The platform "linux" is incompatible with this module.
info "fsevents@1.2.12" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@2.3.1: The platform "linux" is incompatible with this module.
info "fsevents@2.3.1" is an optional dependency and failed compatibility check. Excluding it from installation.
error postcss@8.2.4: The engine "node" is incompatible with this module. Expected version "^10 || ^12 || >=14". Got "13.8.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Aborting installation.
yarnpkg add --exact react react-dom react-scripts cra-template --cwd /home/ficho/workspace/storybook-tutorial has failed.
Deleting generated file... package.json
Deleting generated file... yarn.lock
Deleting storybook-tutorial/ from /home/ficho/workspace
Done.我使用Ubuntu 18.4。
我尝试清除缓存:yarn cache clear并更新npm npm install -g npm@latest
发布于 2021-02-02 20:29:26
升级你的node.js可以解决这个问题。
https://stackoverflow.com/questions/65996379
复制相似问题