googlecodelabs / monolith-to-microservices

Other
207 stars 167 forks source link

Failed to load plugin 'flowtype' #37

Closed chivincent closed 2 years ago

chivincent commented 2 years ago

In GSP662, it failed to execute npm install && npm run-script build.

student_01_349ef68b7c03@cloudshell:~ (qwiklabs-gcp-01-1dff1c6c283a)$ cd ~/monolith-to-microservices/react-app/
student_01_349ef68b7c03@cloudshell:~/monolith-to-microservices/react-app (qwiklabs-gcp-01-1dff1c6c283a)$ npm install && npm run-script build
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@eslint/eslintrc@1.0.5',
npm WARN EBADENGINE   required: { node: '^12.22.0 || ^14.17.0 || >=16.0.0' },
npm WARN EBADENGINE   current: { node: 'v12.14.1', npm: '8.4.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@typescript-eslint/eslint-plugin@5.10.0',
npm WARN EBADENGINE   required: { node: '^12.22.0 || ^14.17.0 || >=16.0.0' },
npm WARN EBADENGINE   current: { node: 'v12.14.1', npm: '8.4.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@typescript-eslint/experimental-utils@5.10.0',
npm WARN EBADENGINE   required: { node: '^12.22.0 || ^14.17.0 || >=16.0.0' },
npm WARN EBADENGINE   current: { node: 'v12.14.1', npm: '8.4.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@typescript-eslint/parser@5.10.0',
npm WARN EBADENGINE   required: { node: '^12.22.0 || ^14.17.0 || >=16.0.0' },
npm WARN EBADENGINE   current: { node: 'v12.14.1', npm: '8.4.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@typescript-eslint/scope-manager@5.10.0',
npm WARN EBADENGINE   required: { node: '^12.22.0 || ^14.17.0 || >=16.0.0' },
npm WARN EBADENGINE   current: { node: 'v12.14.1', npm: '8.4.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@typescript-eslint/type-utils@5.10.0',
npm WARN EBADENGINE   required: { node: '^12.22.0 || ^14.17.0 || >=16.0.0' },
npm WARN EBADENGINE   current: { node: 'v12.14.1', npm: '8.4.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@typescript-eslint/types@5.10.0',
npm WARN EBADENGINE   required: { node: '^12.22.0 || ^14.17.0 || >=16.0.0' },
npm WARN EBADENGINE   current: { node: 'v12.14.1', npm: '8.4.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@typescript-eslint/typescript-estree@5.10.0',
npm WARN EBADENGINE   required: { node: '^12.22.0 || ^14.17.0 || >=16.0.0' },
npm WARN EBADENGINE   current: { node: 'v12.14.1', npm: '8.4.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@typescript-eslint/utils@5.10.0',
npm WARN EBADENGINE   required: { node: '^12.22.0 || ^14.17.0 || >=16.0.0' },
npm WARN EBADENGINE   current: { node: 'v12.14.1', npm: '8.4.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@typescript-eslint/visitor-keys@5.10.0',
npm WARN EBADENGINE   required: { node: '^12.22.0 || ^14.17.0 || >=16.0.0' },
npm WARN EBADENGINE   current: { node: 'v12.14.1', npm: '8.4.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'eslint@8.7.0',
npm WARN EBADENGINE   required: { node: '^12.22.0 || ^14.17.0 || >=16.0.0' },
npm WARN EBADENGINE   current: { node: 'v12.14.1', npm: '8.4.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'eslint-config-react-app@7.0.0',
npm WARN EBADENGINE   required: { node: '>=14.0.0' },
npm WARN EBADENGINE   current: { node: 'v12.14.1', npm: '8.4.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'eslint-plugin-testing-library@5.0.4',
npm WARN EBADENGINE   required: { node: '^12.22.0 || ^14.17.0 || >=16.0.0', npm: '>=6' },
npm WARN EBADENGINE   current: { node: 'v12.14.1', npm: '8.4.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'eslint-scope@7.1.0',
npm WARN EBADENGINE   required: { node: '^12.22.0 || ^14.17.0 || >=16.0.0' },
npm WARN EBADENGINE   current: { node: 'v12.14.1', npm: '8.4.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'eslint-visitor-keys@3.2.0',
npm WARN EBADENGINE   required: { node: '^12.22.0 || ^14.17.0 || >=16.0.0' },
npm WARN EBADENGINE   current: { node: 'v12.14.1', npm: '8.4.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'espree@9.3.0',
npm WARN EBADENGINE   required: { node: '^12.22.0 || ^14.17.0 || >=16.0.0' },
npm WARN EBADENGINE   current: { node: 'v12.14.1', npm: '8.4.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'jest-watch-typeahead@1.0.0',
npm WARN EBADENGINE   required: { node: '^12.22.0 || ^14.17.0 || >=16.0.0' },
npm WARN EBADENGINE   current: { node: 'v12.14.1', npm: '8.4.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'char-regex@2.0.0',
npm WARN EBADENGINE   required: { node: '>=12.20' },
npm WARN EBADENGINE   current: { node: 'v12.14.1', npm: '8.4.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'string-length@5.0.1',
npm WARN EBADENGINE   required: { node: '>=12.20' },
npm WARN EBADENGINE   current: { node: 'v12.14.1', npm: '8.4.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'react-app-polyfill@3.0.0',
npm WARN EBADENGINE   required: { node: '>=14' },
npm WARN EBADENGINE   current: { node: 'v12.14.1', npm: '8.4.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'react-dev-utils@12.0.0',
npm WARN EBADENGINE   required: { node: '>=14' },
npm WARN EBADENGINE   current: { node: 'v12.14.1', npm: '8.4.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'react-scripts@5.0.0',
npm WARN EBADENGINE   required: { node: '>=14.0.0' },
npm WARN EBADENGINE   current: { node: 'v12.14.1', npm: '8.4.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'webpack-manifest-plugin@4.1.1',
npm WARN EBADENGINE   required: { node: '>=12.22.0' },
npm WARN EBADENGINE   current: { node: 'v12.14.1', npm: '8.4.0' }
npm WARN EBADENGINE }
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.

added 1413 packages, and audited 1414 packages in 25s

177 packages are looking for funding
  run `npm fund` for details

8 moderate severity vulnerabilities

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

> frontend@0.1.0 prebuild
> npm run build:monolith

> frontend@0.1.0 build:monolith
> env-cmd -f .env.monolith react-scripts build

Creating an optimized production build...
(node:2602) Warning: require() of ES modules is not supported.
require() of /home/student_01_349ef68b7c03/monolith-to-microservices/react-app/node_modules/@eslint/eslintrc/universal.js from /home/student_01_349ef68b7c03/monolith-to-microservices/react-app/node_modules/eslint/lib/linter/linter.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename universal.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /home/student_01_349ef68b7c03/monolith-to-microservices/react-app/node_modules/@eslint/eslintrc/package.json.
Failed to compile.

Failed to load plugin 'flowtype' declared in 'package.json » eslint-config-react-app': Cannot find module 'eslint/use-at-your-own-risk'
Require stack:
- /home/student_01_349ef68b7c03/monolith-to-microservices/react-app/node_modules/eslint-plugin-flowtype/dist/utilities/getBuiltinRule.js
- /home/student_01_349ef68b7c03/monolith-to-microservices/react-app/node_modules/eslint-plugin-flowtype/dist/rules/noUnusedExpressions.js
- /home/student_01_349ef68b7c03/monolith-to-microservices/react-app/node_modules/eslint-plugin-flowtype/dist/index.js
- /home/student_01_349ef68b7c03/monolith-to-microservices/react-app/node_modules/@eslint/eslintrc/dist/eslintrc.cjs
verbanicm commented 2 years ago

@ChiVincent Can you run nvm install --lts to make sure you are using the latest version of NodeJS? The dependencies were recently updated and this is required. There should have been a message displayed after you ran ./setup.sh in the beginning of the lab.

JZ3736 commented 2 years ago

got similar error. react won't build. error:

npm run build:monolith

frontend@0.1.0 build:monolith env-cmd -f .env.monolith react-scripts build

Creating an optimized production build... (node:1913) Warning: require() of ES modules is not supported. require() of /home/julieboss/monolith-to-microservices/react-app/node_modules/@eslint/eslintrc/universal.js from /home/julieboss/monolith-to-microservices/react-app/node_modules/eslint/lib/linter/linter.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules. Instead rename universal.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /home/julieboss/monolith-to-microservices/react-app/node_modules/@eslint/eslintrc/package.json. Failed to compile.

Failed to load plugin 'flowtype' declared in 'package.json » eslint-config-react-app': Cannot find module 'eslint/use-at-your-own-risk' Require stack:

verbanicm commented 2 years ago

Issue seems to be with not setting NodeJS version using nvm install --lts. Updated README.