Почему, когда я пытаюсь установить магазин соков, у меня много ошибок?

#node.js #typescript #npm

Вопрос:

Затем я попытался установить приложение juice shop из git после npm install того, как я получил 63 ошибки

 [riki@anarchy]: ~/juiceShop/juice-shop>$ npm install
npm WARN npm npm does not support Node.js v12.10.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm You can find the latest version at https://nodejs.org/

> juice-shop@12.10.0 postinstall
> cd frontend amp;amp; npm install --legacy-peer-deps amp;amp; cd .. amp;amp; npm run build:frontend amp;amp; (npm run --silent build:server || cd .)

npm WARN npm npm does not support Node.js v12.10.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm You can find the latest version at https://nodejs.org/
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@angular-devkit/architect@0.1102.14',
npm WARN EBADENGINE   required: { node: '>= 10.13.0', npm: '^6.11.0 || ^7.5.6', yarn: '>= 1.13.0' },
npm WARN EBADENGINE   current: { node: 'v12.10.0', npm: '8.0.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@angular-devkit/build-angular@0.1102.14',
npm WARN EBADENGINE   required: { node: '>= 10.13.0', npm: '^6.11.0 || ^7.5.6', yarn: '>= 1.13.0' },
npm WARN EBADENGINE   current: { node: 'v12.10.0', npm: '8.0.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@angular-devkit/build-optimizer@0.1102.14',
npm WARN EBADENGINE   required: { node: '>= 10.13.0', npm: '^6.11.0 || ^7.5.6', yarn: '>= 1.13.0' },
npm WARN EBADENGINE   current: { node: 'v12.10.0', npm: '8.0.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@angular-devkit/build-webpack@0.1102.14',
npm WARN EBADENGINE   required: { node: '>= 10.13.0', npm: '^6.11.0 || ^7.5.6', yarn: '>= 1.13.0' },
npm WARN EBADENGINE   current: { node: 'v12.10.0', npm: '8.0.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@angular-devkit/core@11.2.14',
npm WARN EBADENGINE   required: { node: '>= 10.13.0', npm: '^6.11.0 || ^7.5.6', yarn: '>= 1.13.0' },
npm WARN EBADENGINE   current: { node: 'v12.10.0', npm: '8.0.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@angular-devkit/schematics@11.2.14',
npm WARN EBADENGINE   required: { node: '>= 10.13.0', npm: '^6.11.0 || ^7.5.6', yarn: '>= 1.13.0' },
npm WARN EBADENGINE   current: { node: 'v12.10.0', npm: '8.0.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@angular/cli@11.2.14',
npm WARN EBADENGINE   required: { node: '>= 10.13.0', npm: '^6.11.0 || ^7.5.6', yarn: '>= 1.13.0' },
npm WARN EBADENGINE   current: { node: 'v12.10.0', npm: '8.0.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@ngtools/webpack@11.2.14',
npm WARN EBADENGINE   required: { node: '>= 10.13.0', npm: '^6.11.0 || ^7.5.6', yarn: '>= 1.13.0' },
npm WARN EBADENGINE   current: { node: 'v12.10.0', npm: '8.0.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@schematics/angular@11.2.14',
npm WARN EBADENGINE   required: { node: '>= 10.13.0', npm: '^6.11.0 || ^7.5.6', yarn: '>= 1.13.0' },
npm WARN EBADENGINE   current: { node: 'v12.10.0', npm: '8.0.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@schematics/update@0.1102.14',
npm WARN EBADENGINE   required: { node: '>= 10.13.0', npm: '^6.11.0 || ^7.5.6', yarn: '>= 1.13.0' },
npm WARN EBADENGINE   current: { node: 'v12.10.0', npm: '8.0.0' }
npm WARN EBADENGINE }

> frontend@12.10.0 postinstall
> ngcc --tsconfig "./src/tsconfig.app.json"


up to date, audited 1728 packages in 8s

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

27 vulnerabilities (6 moderate, 21 high)

To address issues that do not require attention, run:
  npm audit fix

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
npm WARN npm npm does not support Node.js v12.10.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm You can find the latest version at https://nodejs.org/

> juice-shop@12.10.0 build:frontend
> cd frontend amp;amp; node ./node_modules/@angular/cli/bin/ng build --aot --prod --output-hashing=none --vendor-chunk=true --source-map=false

Warning: Using differential loading with targets ES5 and ES2016 or higher may
cause problems. Browsers with support for ES2015 will load the ES2016  scripts
referenced with script[type="module"] but they may not support ES2016  syntax.
✔ Browser application bundle generation complete.
✔ ES5 bundle generation complete.
✔ Copying assets complete.
✔ Index html generation complete.

Initial Chunk Files | Names                |      Size
vendor-es5.js       | vendor               |   1.59 MB
vendor-es2018.js    | vendor               |   1.44 MB
styles.css          | styles               | 590.10 kB
main-es5.js         | main                 | 402.51 kB
main-es2018.js      | main                 | 379.83 kB
polyfills-es5.js    | polyfills-es5        | 152.48 kB
polyfills-es2018.js | polyfills            |  56.83 kB
runtime-es2018.js   | runtime              |   2.21 kB
runtime-es5.js      | runtime              |   2.21 kB

                    | Initial ES5 Total    |   2.71 MB
                    | Initial ES2018 Total |   2.44 MB

Lazy Chunk Files    | Names                |      Size
tutorial-es5.js     | tutorial             |  30.14 kB
tutorial-es2018.js  | tutorial             |  25.37 kB
8-es5.js            | -                    |  24.84 kB
8-es2018.js         | -                    |  20.08 kB
1-es5.js            | -                    |   7.47 kB
1-es2018.js         | -                    |   7.47 kB
10-es5.js           | -                    |   6.20 kB
10-es2018.js        | -                    |   6.05 kB
9-es5.js            | -                    |   5.28 kB
9-es2018.js         | -                    |   5.17 kB
12-es2018.js        | -                    |   3.28 kB
12-es5.js           | -                    |   3.28 kB
11-es5.js           | -                    |   1.71 kB
11-es2018.js        | -                    |   1.70 kB

Build at: 2021-10-10T13:01:13.085Z - Hash: 4fd8017a8783a22d1bb1 - Time: 70059ms
data/static/codefixes/localXssChallenge_1.ts:1:16 - error TS1005: ';' expected.

1 filterTable () {
                 ~

data/static/codefixes/localXssChallenge_2_correct.ts:1:16 - error TS1005: ';' expected.

1 filterTable () {
                 ~

data/static/codefixes/localXssChallenge_3.ts:1:16 - error TS1005: ';' expected.

1 filterTable () {
                 ~

data/static/codefixes/localXssChallenge_4.ts:1:16 - error TS1005: ';' expected.

1 filterTable () {
                 ~

data/static/codefixes/loginAdminChallenge_1.ts:39:4 - error TS1005: '}' expected.

39   }
      

  data/static/codefixes/loginAdminChallenge_1.ts:1:36
    1 module.exports = function login () {
                                         ~
    The parser expected to find a '}' to match the '{' token here.

data/static/codefixes/loginAdminChallenge_2.ts:37:4 - error TS1005: '}' expected.

37   }
      

  data/static/codefixes/loginAdminChallenge_2.ts:1:36
    1 module.exports = function login () {
                                         ~
    The parser expected to find a '}' to match the '{' token here.

data/static/codefixes/loginAdminChallenge_3.ts:37:4 - error TS1005: '}' expected.

37   }
      

  data/static/codefixes/loginAdminChallenge_3.ts:1:36
    1 module.exports = function login () {
                                         ~
    The parser expected to find a '}' to match the '{' token here.

data/static/codefixes/loginAdminChallenge_4_correct.ts:37:4 - error TS1005: '}' expected.

37   }
      

  data/static/codefixes/loginAdminChallenge_4_correct.ts:1:36
    1 module.exports = function login () {
                                         ~
    The parser expected to find a '}' to match the '{' token here.

data/static/codefixes/loginBenderChallenge_1.ts:39:4 - error TS1005: '}' expected.

39   }
      

  data/static/codefixes/loginBenderChallenge_1.ts:1:36
    1 module.exports = function login () {
                                         ~
    The parser expected to find a '}' to match the '{' token here.

data/static/codefixes/loginBenderChallenge_2_correct.ts:37:4 - error TS1005: '}' expected.

37   }
      

  data/static/codefixes/loginBenderChallenge_2_correct.ts:1:36
    1 module.exports = function login () {
                                         ~
    The parser expected to find a '}' to match the '{' token here.

data/static/codefixes/loginBenderChallenge_3.ts:37:4 - error TS1005: '}' expected.

37   }
      

  data/static/codefixes/loginBenderChallenge_3.ts:1:36
    1 module.exports = function login () {
                                         ~
    The parser expected to find a '}' to match the '{' token here.

data/static/codefixes/loginBenderChallenge_4.ts:36:4 - error TS1005: '}' expected.

36   }
      

  data/static/codefixes/loginBenderChallenge_4.ts:1:36
    1 module.exports = function login () {
                                         ~
    The parser expected to find a '}' to match the '{' token here.

data/static/codefixes/loginJimChallenge_1_correct.ts:37:4 - error TS1005: '}' expected.

37   }
      

  data/static/codefixes/loginJimChallenge_1_correct.ts:1:36
    1 module.exports = function login () {
                                         ~
    The parser expected to find a '}' to match the '{' token here.

data/static/codefixes/loginJimChallenge_2.ts:36:4 - error TS1005: '}' expected.

36   }
      

  data/static/codefixes/loginJimChallenge_2.ts:1:36
    1 module.exports = function login () {
                                         ~
    The parser expected to find a '}' to match the '{' token here.

data/static/codefixes/loginJimChallenge_3.ts:37:4 - error TS1005: '}' expected.

37   }
      

  data/static/codefixes/loginJimChallenge_3.ts:1:36
    1 module.exports = function login () {
                                         ~
    The parser expected to find a '}' to match the '{' token here.

data/static/codefixes/loginJimChallenge_4.ts:39:4 - error TS1005: '}' expected.

39   }
      

  data/static/codefixes/loginJimChallenge_4.ts:1:36
    1 module.exports = function login () {
                                         ~
    The parser expected to find a '}' to match the '{' token here.

data/static/codefixes/registerAdminChallenge_1.ts:37:1 - error TS1005: '}' expected.

37 
   

  data/static/codefixes/registerAdminChallenge_1.ts:20:47
    20   for (const { name, exclude } of autoModels) {
                                                     ~
    The parser expected to find a '}' to match the '{' token here.

data/static/codefixes/registerAdminChallenge_2.ts:24:7 - error TS1005: '}' expected.

24     })
         

  data/static/codefixes/registerAdminChallenge_2.ts:19:47
    19   for (const { name, exclude } of autoModels) {
                                                     ~
    The parser expected to find a '}' to match the '{' token here.

data/static/codefixes/registerAdminChallenge_3_correct.ts:36:6 - error TS1005: '}' expected.

36     }
        

  data/static/codefixes/registerAdminChallenge_3_correct.ts:20:47
    20   for (const { name, exclude } of autoModels) {
                                                     ~
    The parser expected to find a '}' to match the '{' token here.

data/static/codefixes/registerAdminChallenge_4.ts:32:6 - error TS1005: '}' expected.

32     }
        

  data/static/codefixes/registerAdminChallenge_4.ts:20:47
    20   for (const { name, exclude } of autoModels) {
                                                     ~
    The parser expected to find a '}' to match the '{' token here.

data/static/codefixes/restfulXssChallenge_1_correct.ts:1:20 - error TS1005: ';' expected.

1 ngAfterViewInit () {
                     ~

data/static/codefixes/restfulXssChallenge_2.ts:1:20 - error TS1005: ';' expected.

1 ngAfterViewInit () {
                     ~

data/static/codefixes/restfulXssChallenge_2.ts:57:38 - error TS1005: ',' expected.

57   encodeProductDescription (tableData: any[]) {
                                        ~

data/static/codefixes/restfulXssChallenge_2.ts:57:44 - error TS1011: An element access expression should take an argument.

57   encodeProductDescription (tableData: any[]) {
                                              

data/static/codefixes/restfulXssChallenge_2.ts:57:47 - error TS1005: ';' expected.

57   encodeProductDescription (tableData: any[]) {
                                                 ~

data/static/codefixes/restfulXssChallenge_3.ts:1:20 - error TS1005: ';' expected.

1 ngAfterViewInit () {
                     ~

data/static/codefixes/restfulXssChallenge_3.ts:43:37 - error TS1005: ',' expected.

43   trustProductDescription (tableData: any[]) {
                                       ~

data/static/codefixes/restfulXssChallenge_3.ts:43:43 - error TS1011: An element access expression should take an argument.

43   trustProductDescription (tableData: any[]) {
                                             

data/static/codefixes/restfulXssChallenge_3.ts:43:46 - error TS1005: ';' expected.

43   trustProductDescription (tableData: any[]) {
                                                ~

data/static/codefixes/restfulXssChallenge_4.ts:1:20 - error TS1005: ';' expected.

1 ngAfterViewInit () {
                     ~

data/static/codefixes/restfulXssChallenge_4.ts:57:37 - error TS1005: ',' expected.

57   trustProductDescription (tableData: any[]) {
                                       ~

data/static/codefixes/restfulXssChallenge_4.ts:57:43 - error TS1011: An element access expression should take an argument.

57   trustProductDescription (tableData: any[]) {
                                             

data/static/codefixes/restfulXssChallenge_4.ts:57:46 - error TS1005: ';' expected.

57   trustProductDescription (tableData: any[]) {
                                                ~

data/static/codefixes/tokenSaleChallenge_1.ts:3:9 - error TS1005: ';' expected.

3     data: { params: (window.location.href).substr(window.location.href.indexOf('#')) },
          ~

data/static/codefixes/tokenSaleChallenge_1.ts:3:87 - error TS1128: Declaration or statement expected.

3     data: { params: (window.location.href).substr(window.location.href.indexOf('#')) },
                                                                                        ~

data/static/codefixes/tokenSaleChallenge_1.ts:5:4 - error TS1128: Declaration or statement expected.

5   },
     ~

data/static/codefixes/tokenSaleChallenge_1.ts:8:14 - error TS1005: ';' expected.

8     component: TokenSaleComponent
               ~

data/static/codefixes/tokenSaleChallenge_1.ts:9:4 - error TS1128: Declaration or statement expected.

9   },
     ~

data/static/codefixes/tokenSaleChallenge_1.ts:12:14 - error TS1005: ';' expected.

12     component: ErrorPageComponent
                ~

data/static/codefixes/tokenSaleChallenge_1.ts:13:4 - error TS1128: Declaration or statement expected.

13   },
      ~

data/static/codefixes/tokenSaleChallenge_1.ts:16:14 - error TS1005: ';' expected.

16     component: SearchResultComponent
                ~

data/static/codefixes/tokenSaleChallenge_1.ts:18:1 - error TS1128: Declaration or statement expected.

18 ]
   ~

data/static/codefixes/tokenSaleChallenge_2.ts:3:9 - error TS1005: ';' expected.

3     data: { params: (window.location.href).substr(window.location.href.indexOf('#')) },
          ~

data/static/codefixes/tokenSaleChallenge_2.ts:3:87 - error TS1128: Declaration or statement expected.

3     data: { params: (window.location.href).substr(window.location.href.indexOf('#')) },
                                                                                        ~

data/static/codefixes/tokenSaleChallenge_2.ts:5:4 - error TS1128: Declaration or statement expected.

5   },
     ~

data/static/codefixes/tokenSaleChallenge_2.ts:8:14 - error TS1005: ';' expected.

8     component: TokenSaleComponent,
               ~

data/static/codefixes/tokenSaleChallenge_2.ts:9:16 - error TS1005: ';' expected.

9     canActivate: [AdminGuard]
                 ~

data/static/codefixes/tokenSaleChallenge_2.ts:10:4 - error TS1128: Declaration or statement expected.

10   },
      ~

data/static/codefixes/tokenSaleChallenge_2.ts:13:14 - error TS1005: ';' expected.

13     component: ErrorPageComponent
                ~

data/static/codefixes/tokenSaleChallenge_2.ts:14:4 - error TS1128: Declaration or statement expected.

14   },
      ~

data/static/codefixes/tokenSaleChallenge_2.ts:17:14 - error TS1005: ';' expected.

17     component: SearchResultComponent
                ~

data/static/codefixes/tokenSaleChallenge_2.ts:19:1 - error TS1128: Declaration or statement expected.

19 ]
   ~

data/static/codefixes/tokenSaleChallenge_3_correct.ts:3:9 - error TS1005: ';' expected.

3     data: { params: (window.location.href).substr(window.location.href.indexOf('#')) },
          ~

data/static/codefixes/tokenSaleChallenge_3_correct.ts:3:87 - error TS1128: Declaration or statement expected.

3     data: { params: (window.location.href).substr(window.location.href.indexOf('#')) },
                                                                                        ~

data/static/codefixes/tokenSaleChallenge_3_correct.ts:5:4 - error TS1128: Declaration or statement expected.

5   },
     ~

data/static/codefixes/tokenSaleChallenge_3_correct.ts:8:14 - error TS1005: ';' expected.

8     component: ErrorPageComponent
               ~

data/static/codefixes/tokenSaleChallenge_3_correct.ts:9:4 - error TS1128: Declaration or statement expected.

9   },
     ~

data/static/codefixes/tokenSaleChallenge_3_correct.ts:12:14 - error TS1005: ';' expected.

12     component: SearchResultComponent
                ~

data/static/codefixes/tokenSaleChallenge_3_correct.ts:14:1 - error TS1128: Declaration or statement expected.

14 ]
   ~

data/static/codefixes/xssBonusChallenge_1_correct.ts:1:16 - error TS1005: ';' expected.

1 filterTable () {
                 ~

data/static/codefixes/xssBonusChallenge_2.ts:1:16 - error TS1005: ';' expected.

1 filterTable () {
                 ~

data/static/codefixes/xssBonusChallenge_3.ts:1:16 - error TS1005: ';' expected.

1 filterTable () {
                 ~

data/static/codefixes/xssBonusChallenge_4.ts:1:16 - error TS1005: ';' expected.

1 filterTable () {
                 ~


Found 63 errors.


up to date, audited 2021 packages in 2m

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

52 vulnerabilities (13 moderate, 35 high, 4 critical)

To address issues that do not require attention, run:
  npm audit fix

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

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
 

Ответ №1:

Не могли бы вы проверить свою версию npm, запустив npm -v ?

Мое дикое предположение заключается в том, что вы используете npm7, который не совместим с узлом v12.

Вместо этого попробуйте понизить рейтинг до npm6.

Комментарии:

1. Я пытался понизить версию npm до 6.11.0 и нескольких других. Но все это меня не поддерживает. У меня все те же 63 ошибки. Я пытался измениться node.js версия тоже. Но и это не сработало