创建项目运行报错

来源:2-2 React开发环境准备

qq_陌_45

2020-07-15

wdeMacBook-Air:todolist wlk$ npm start


> todolist@0.1.0 start /Users/wlk/Desktop/react-look/todolist

> react-scripts start



There might be a problem with the project dependency tree.

It is likely not a bug in Create React App, but something you need to fix locally.


The react-scripts package provided by Create React App requires a dependency:


  "webpack": "4.28.3"


Don't try to install it manually: your package manager does it automatically.

However, a different version of webpack was detected higher up in the tree:


  /Users/wlk/node_modules/webpack (version: 4.20.2) 


Manually installing incompatible versions is known to cause hard-to-debug issues.


If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.

That will permanently disable this message but you might encounter other issues.


To fix the dependency tree, try following the steps below in the exact order:


  1. Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.

  2. Delete node_modules in your project folder.

  3. Remove "webpack" from dependencies and/or devDependencies in the package.json file in your project folder.

  4. Run npm install or yarn, depending on the package manager you use.


In most cases, this should be enough to fix the problem.

If this has not helped, there are a few other things you can try:


  5. If you used npm, install yarn (http://yarnpkg.com/) and repeat the above steps with it instead.

     This may help because npm has known issues with package hoisting which may get resolved in future versions.


  6. Check if /Users/wlk/node_modules/webpack is outside your project directory.

     For example, you might have accidentally installed something in your home folder.


  7. Try running npm ls webpack in your project folder.

     This will tell you which other package (apart from the expected react-scripts) installed webpack.


If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.

That would permanently disable this preflight check in case you want to proceed anyway.


wdeMacBook-Air:todolist wlk$ npm install

npm WARN deprecated @hapi/joi@15.1.1: This version has been deprecated and is no longer supported or maintained

npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.

npm WARN deprecated @hapi/address@2.1.4: This version has been deprecated and is no longer supported or maintained

npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained

npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained

npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained

npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()

npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.

npm WARN deprecated core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.


> fsevents@1.2.13 install /Users/wlk/Desktop/react-look/todolist/node_modules/jest-haste-map/node_modules/fsevents

> node install.js


  SOLINK_MODULE(target) Release/.node

  CXX(target) Release/obj.target/fse/fsevents.o

  SOLINK_MODULE(target) Release/fse.node


> fsevents@1.2.13 install /Users/wlk/Desktop/react-look/todolist/node_modules/watchpack-chokidar2/node_modules/fsevents

> node install.js


  SOLINK_MODULE(target) Release/.node

  CXX(target) Release/obj.target/fse/fsevents.o

  SOLINK_MODULE(target) Release/fse.node


> fsevents@1.2.13 install /Users/wlk/Desktop/react-look/todolist/node_modules/webpack-dev-server/node_modules/fsevents

> node install.js


  SOLINK_MODULE(target) Release/.node

  CXX(target) Release/obj.target/fse/fsevents.o

  SOLINK_MODULE(target) Release/fse.node


> core-js@2.6.11 postinstall /Users/wlk/Desktop/react-look/todolist/node_modules/babel-runtime/node_modules/core-js

> node -e "try{require('./postinstall')}catch(e){}"


Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!


The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 

> https://opencollective.com/core-js 

> https://www.patreon.com/zloirock 


Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)



> core-js@3.6.5 postinstall /Users/wlk/Desktop/react-look/todolist/node_modules/core-js

> node -e "try{require('./postinstall')}catch(e){}"



> core-js-pure@3.6.5 postinstall /Users/wlk/Desktop/react-look/todolist/node_modules/core-js-pure

> node -e "try{require('./postinstall')}catch(e){}"


npm WARN react-scripts@3.4.1 requires a peer of typescript@^3.2.1 but none is installed. You must install peer dependencies yourself.

npm WARN sass-loader@8.0.2 requires a peer of node-sass@^4.0.0 but none is installed. You must install peer dependencies yourself.

npm WARN sass-loader@8.0.2 requires a peer of sass@^1.3.0 but none is installed. You must install peer dependencies yourself.

npm WARN sass-loader@8.0.2 requires a peer of fibers@>= 3.1.0 but none is installed. You must install peer dependencies yourself.

npm WARN tsutils@3.17.1 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.


added 1631 packages from 799 contributors and audited 1631 packages in 192.025s

found 1 low severity vulnerability

  run `npm audit fix` to fix them, or `npm audit` for details

wdeMacBook-Air:todolist wlk$ npm start


> todolist@0.1.0 start /Users/wlk/Desktop/react-look/todolist

> react-scripts start



There might be a problem with the project dependency tree.

It is likely not a bug in Create React App, but something you need to fix locally.


The react-scripts package provided by Create React App requires a dependency:


  "webpack": "4.42.0"


Don't try to install it manually: your package manager does it automatically.

However, a different version of webpack was detected higher up in the tree:


  /Users/wlk/node_modules/webpack (version: 4.20.2) 


Manually installing incompatible versions is known to cause hard-to-debug issues.


If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.

That will permanently disable this message but you might encounter other issues.


To fix the dependency tree, try following the steps below in the exact order:


  1. Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.

  2. Delete node_modules in your project folder.

  3. Remove "webpack" from dependencies and/or devDependencies in the package.json file in your project folder.

  4. Run npm install or yarn, depending on the package manager you use.


In most cases, this should be enough to fix the problem.

If this has not helped, there are a few other things you can try:


  5. If you used npm, install yarn (http://yarnpkg.com/) and repeat the above steps with it instead.

     This may help because npm has known issues with package hoisting which may get resolved in future versions.


  6. Check if /Users/wlk/node_modules/webpack is outside your project directory.

     For example, you might have accidentally installed something in your home folder.


  7. Try running npm ls webpack in your project folder.

     This will tell you which other package (apart from the expected react-scripts) installed webpack.


If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.

That would permanently disable this preflight check in case you want to proceed anyway.


P.S. We know this message is long but please read the steps above :-) We hope you find them helpful!


npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! todolist@0.1.0 start: `react-scripts start`

npm ERR! Exit status 1

npm ERR! 

npm ERR! Failed at the todolist@0.1.0 start script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.


npm ERR! A complete log of this run can be found in:

npm ERR!     /Users/wlk/.npm/_logs/2020-07-15T13_38_44_377Z-debug.log

wdeMacBook-Air:todolist wlk$ npm run start


> todolist@0.1.0 start /Users/wlk/Desktop/react-look/todolist

> react-scripts start



There might be a problem with the project dependency tree.

It is likely not a bug in Create React App, but something you need to fix locally.


The react-scripts package provided by Create React App requires a dependency:


  "webpack": "4.42.0"


Don't try to install it manually: your package manager does it automatically.

However, a different version of webpack was detected higher up in the tree:


  /Users/wlk/node_modules/webpack (version: 4.20.2) 


Manually installing incompatible versions is known to cause hard-to-debug issues.


If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.

That will permanently disable this message but you might encounter other issues.


To fix the dependency tree, try following the steps below in the exact order:


  1. Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.

  2. Delete node_modules in your project folder.

  3. Remove "webpack" from dependencies and/or devDependencies in the package.json file in your project folder.

  4. Run npm install or yarn, depending on the package manager you use.


In most cases, this should be enough to fix the problem.

If this has not helped, there are a few other things you can try:


  5. If you used npm, install yarn (http://yarnpkg.com/) and repeat the above steps with it instead.

     This may help because npm has known issues with package hoisting which may get resolved in future versions.


  6. Check if /Users/wlk/node_modules/webpack is outside your project directory.

     For example, you might have accidentally installed something in your home folder.


  7. Try running npm ls webpack in your project folder.

     This will tell you which other package (apart from the expected react-scripts) installed webpack.


If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.

That would permanently disable this preflight check in case you want to proceed anyway.


P.S. We know this message is long but please read the steps above :-) We hope you find them helpful!


npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! todolist@0.1.0 start: `react-scripts start`

npm ERR! Exit status 1

npm ERR! 

npm ERR! Failed at the todolist@0.1.0 start script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.


npm ERR! A complete log of this run can be found in:

npm ERR!     /Users/wlk/.npm/_logs/2020-07-15T13_38_49_474Z-debug.log



1.尝试了删除node_modules 重新npm install还是不行

2.webpack版本是4.20.2

请问如何解决?


写回答

1回答

qq_陌_45

提问者

2020-07-15

这是npm install时候报的错,看不懂怎么弄


The default interactive shell is now zsh.

To update your account to use zsh, please run `chsh -s /bin/zsh`.

For more details, please visit https://support.apple.com/kb/HT208050.

wdeMacBook-Air:todolist wlk$ npm start


> todolist@0.1.0 start /Users/wlk/Desktop/react-look/todolist

> react-scripts start



There might be a problem with the project dependency tree.

It is likely not a bug in Create React App, but something you need to fix locally.


The react-scripts package provided by Create React App requires a dependency:


  "webpack": "4.28.3"


Don't try to install it manually: your package manager does it automatically.

However, a different version of webpack was detected higher up in the tree:


  /Users/wlk/node_modules/webpack (version: 4.20.2) 


Manually installing incompatible versions is known to cause hard-to-debug issues.


If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.

That will permanently disable this message but you might encounter other issues.


To fix the dependency tree, try following the steps below in the exact order:


  1. Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.

  2. Delete node_modules in your project folder.

  3. Remove "webpack" from dependencies and/or devDependencies in the package.json file in your project folder.

  4. Run npm install or yarn, depending on the package manager you use.


In most cases, this should be enough to fix the problem.

If this has not helped, there are a few other things you can try:


  5. If you used npm, install yarn (http://yarnpkg.com/) and repeat the above steps with it instead.

     This may help because npm has known issues with package hoisting which may get resolved in future versions.


  6. Check if /Users/wlk/node_modules/webpack is outside your project directory.

     For example, you might have accidentally installed something in your home folder.


  7. Try running npm ls webpack in your project folder.

     This will tell you which other package (apart from the expected react-scripts) installed webpack.


If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.

That would permanently disable this preflight check in case you want to proceed anyway.


wdeMacBook-Air:todolist wlk$ npm install

npm WARN deprecated @hapi/joi@15.1.1: This version has been deprecated and is no longer supported or maintained

npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.

npm WARN deprecated @hapi/address@2.1.4: This version has been deprecated and is no longer supported or maintained

npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained

npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained

npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained

npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()

npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.

npm WARN deprecated core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.


> fsevents@1.2.13 install /Users/wlk/Desktop/react-look/todolist/node_modules/jest-haste-map/node_modules/fsevents

> node install.js


  SOLINK_MODULE(target) Release/.node

  CXX(target) Release/obj.target/fse/fsevents.o

  SOLINK_MODULE(target) Release/fse.node


> fsevents@1.2.13 install /Users/wlk/Desktop/react-look/todolist/node_modules/watchpack-chokidar2/node_modules/fsevents

> node install.js


  SOLINK_MODULE(target) Release/.node

  CXX(target) Release/obj.target/fse/fsevents.o

  SOLINK_MODULE(target) Release/fse.node


> fsevents@1.2.13 install /Users/wlk/Desktop/react-look/todolist/node_modules/webpack-dev-server/node_modules/fsevents

> node install.js


  SOLINK_MODULE(target) Release/.node

  CXX(target) Release/obj.target/fse/fsevents.o

  SOLINK_MODULE(target) Release/fse.node


> core-js@2.6.11 postinstall /Users/wlk/Desktop/react-look/todolist/node_modules/babel-runtime/node_modules/core-js

> node -e "try{require('./postinstall')}catch(e){}"


Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!


The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 

> https://opencollective.com/core-js 

> https://www.patreon.com/zloirock 


Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)



> core-js@3.6.5 postinstall /Users/wlk/Desktop/react-look/todolist/node_modules/core-js

> node -e "try{require('./postinstall')}catch(e){}"



> core-js-pure@3.6.5 postinstall /Users/wlk/Desktop/react-look/todolist/node_modules/core-js-pure

> node -e "try{require('./postinstall')}catch(e){}"


npm WARN react-scripts@3.4.1 requires a peer of typescript@^3.2.1 but none is installed. You must install peer dependencies yourself.

npm WARN sass-loader@8.0.2 requires a peer of node-sass@^4.0.0 but none is installed. You must install peer dependencies yourself.

npm WARN sass-loader@8.0.2 requires a peer of sass@^1.3.0 but none is installed. You must install peer dependencies yourself.

npm WARN sass-loader@8.0.2 requires a peer of fibers@>= 3.1.0 but none is installed. You must install peer dependencies yourself.

npm WARN tsutils@3.17.1 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.


added 1631 packages from 799 contributors and audited 1631 packages in 192.025s

found 1 low severity vulnerability

  run `npm audit fix` to fix them, or `npm audit` for details

wdeMacBook-Air:todolist wlk$ npm start


> todolist@0.1.0 start /Users/wlk/Desktop/react-look/todolist

> react-scripts start



There might be a problem with the project dependency tree.

It is likely not a bug in Create React App, but something you need to fix locally.


The react-scripts package provided by Create React App requires a dependency:


  "webpack": "4.42.0"


Don't try to install it manually: your package manager does it automatically.

However, a different version of webpack was detected higher up in the tree:


  /Users/wlk/node_modules/webpack (version: 4.20.2) 


Manually installing incompatible versions is known to cause hard-to-debug issues.


If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.

That will permanently disable this message but you might encounter other issues.


To fix the dependency tree, try following the steps below in the exact order:


  1. Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.

  2. Delete node_modules in your project folder.

  3. Remove "webpack" from dependencies and/or devDependencies in the package.json file in your project folder.

  4. Run npm install or yarn, depending on the package manager you use.


In most cases, this should be enough to fix the problem.

If this has not helped, there are a few other things you can try:


  5. If you used npm, install yarn (http://yarnpkg.com/) and repeat the above steps with it instead.

     This may help because npm has known issues with package hoisting which may get resolved in future versions.


  6. Check if /Users/wlk/node_modules/webpack is outside your project directory.

     For example, you might have accidentally installed something in your home folder.


  7. Try running npm ls webpack in your project folder.

     This will tell you which other package (apart from the expected react-scripts) installed webpack.


If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.

That would permanently disable this preflight check in case you want to proceed anyway.


P.S. We know this message is long but please read the steps above :-) We hope you find them helpful!


npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! todolist@0.1.0 start: `react-scripts start`

npm ERR! Exit status 1

npm ERR! 

npm ERR! Failed at the todolist@0.1.0 start script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.


npm ERR! A complete log of this run can be found in:

npm ERR!     /Users/wlk/.npm/_logs/2020-07-15T13_38_44_377Z-debug.log

wdeMacBook-Air:todolist wlk$ npm run start


> todolist@0.1.0 start /Users/wlk/Desktop/react-look/todolist

> react-scripts start



There might be a problem with the project dependency tree.

It is likely not a bug in Create React App, but something you need to fix locally.


The react-scripts package provided by Create React App requires a dependency:


  "webpack": "4.42.0"


Don't try to install it manually: your package manager does it automatically.

However, a different version of webpack was detected higher up in the tree:


  /Users/wlk/node_modules/webpack (version: 4.20.2) 


Manually installing incompatible versions is known to cause hard-to-debug issues.


If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.

That will permanently disable this message but you might encounter other issues.


To fix the dependency tree, try following the steps below in the exact order:


  1. Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.

  2. Delete node_modules in your project folder.

  3. Remove "webpack" from dependencies and/or devDependencies in the package.json file in your project folder.

  4. Run npm install or yarn, depending on the package manager you use.


In most cases, this should be enough to fix the problem.

If this has not helped, there are a few other things you can try:


  5. If you used npm, install yarn (http://yarnpkg.com/) and repeat the above steps with it instead.

     This may help because npm has known issues with package hoisting which may get resolved in future versions.


  6. Check if /Users/wlk/node_modules/webpack is outside your project directory.

     For example, you might have accidentally installed something in your home folder.


  7. Try running npm ls webpack in your project folder.

     This will tell you which other package (apart from the expected react-scripts) installed webpack.


If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.

That would permanently disable this preflight check in case you want to proceed anyway.


P.S. We know this message is long but please read the steps above :-) We hope you find them helpful!


npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! todolist@0.1.0 start: `react-scripts start`

wdeMacBook-Air:todolist wlk$ npm i


> fsevents@1.2.13 install /Users/wlk/Desktop/react-look/todolist/node_modules/jest-haste-map/node_modules/fsevents

> node install.js


  SOLINK_MODULE(target) Release/.node

  CXX(target) Release/obj.target/fse/fsevents.o

  SOLINK_MODULE(target) Release/fse.node


> fsevents@1.2.13 install /Users/wlk/Desktop/react-look/todolist/node_modules/watchpack-chokidar2/node_modules/fsevents

> node install.js


  SOLINK_MODULE(target) Release/.node

  CXX(target) Release/obj.target/fse/fsevents.o

  SOLINK_MODULE(target) Release/fse.node


> fsevents@1.2.13 install /Users/wlk/Desktop/react-look/todolist/node_modules/webpack-dev-server/node_modules/fsevents

> node install.js


  SOLINK_MODULE(target) Release/.node

  CXX(target) Release/obj.target/fse/fsevents.o

  SOLINK_MODULE(target) Release/fse.node


> core-js@2.6.11 postinstall /Users/wlk/Desktop/react-look/todolist/node_modules/babel-runtime/node_modules/core-js

> node -e "try{require('./postinstall')}catch(e){}"


Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!


The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 

> https://opencollective.com/core-js 

> https://www.patreon.com/zloirock 


Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)



> core-js@3.6.5 postinstall /Users/wlk/Desktop/react-look/todolist/node_modules/core-js

> node -e "try{require('./postinstall')}catch(e){}"



> core-js-pure@3.6.5 postinstall /Users/wlk/Desktop/react-look/todolist/node_modules/core-js-pure

> node -e "try{require('./postinstall')}catch(e){}"


added 1631 packages from 799 contributors and audited 1631 packages in 77.1s

found 1 low severity vulnerability

  run `npm audit fix` to fix them, or `npm audit` for details

wdeMacBook-Air:todolist wlk$ 


0
1
Dell
你把报错的片段发上来就可以了,其他不要。
2020-07-18
共1条回复

React零基础入门到实战,完成企业级项目简书网站开发

主流新技术 React-redux,React-router4,贯穿基础语法

5275 学习 · 2496 问题

查看课程