Errp no typescript no angular - resolvido

Está com este erro

Option "showCircularDependencies" is deprecated: The recommended method to detect circular dependencies in project code is to use either a lint rule or other external tooling.
⠋ Generating browser application bundles (phase: setup)...C:\sistemas\angular\Kcms.Erp.Web\node_modules\@angular\compiler-cli\src\typescript_support.js:65
            throw new Error("The Angular Compiler requires TypeScript >=" + minVersion + " and <" + maxVersion + " but " + version + " was found instead.");
            ^

Error: The Angular Compiler requires TypeScript >=4.2.3 and <4.3.0 but 4.3.4 was found instead.
    at checkVersion (C:\sistemas\angular\Kcms.Erp.Web\node_modules\@angular\compiler-cli\src\typescript_support.js:65:19)
    at Object.verifySupportedTypeScriptVersion (C:\sistemas\angular\Kcms.Erp.Web\node_modules\@angular\compiler-cli\src\typescript_support.js:70:9)
    at new NgtscProgram (C:\sistemas\angular\Kcms.Erp.Web\node_modules\@angular\compiler-cli\src\ngtsc\program.js:44:38)
    at AngularWebpackPlugin.updateAotProgram (C:\sistemas\angular\Kcms.Erp.Web\node_modules\@ngtools\webpack\src\ivy\plugin.js:278:32)
    at C:\sistemas\angular\Kcms.Erp.Web\node_modules\@ngtools\webpack\src\ivy\plugin.js:167:24
    at Hook.eval [as call] (eval at create (C:\sistemas\angular\Kcms.Erp.Web\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:22:1)
    at Hook.CALL_DELEGATE [as _call] (C:\sistemas\angular\Kcms.Erp.Web\node_modules\tapable\lib\Hook.js:14:14)
    at Compiler.newCompilation (C:\sistemas\angular\Kcms.Erp.Web\node_modules\webpack\lib\Compiler.js:1033:30)
    at C:\sistemas\angular\Kcms.Erp.Web\node_modules\webpack\lib\Compiler.js:1076:29
    at Hook.eval [as callAsync] (eval at create (C:\sistemas\angular\Kcms.Erp.Web\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:20:1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! smartadmin@0.5.0 start: `ng serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the smartadmin@0.5.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!     C:\Users\guilh\AppData\Roaming\npm-cache\_logs\2021-06-23T01_47_32_249Z-debug.log

Mas o “typescript”: “^4.3.4”,

O que pode ser ?

Log

0 info it worked if it ends with ok

1 verbose cli [

1 verbose cli ‘C:\Program Files\nodejs\node.exe’,

1 verbose cli ‘C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js’,

1 verbose cli ‘start’

1 verbose cli ]

2 info using npm@6.14.6

3 info using node@v12.18.3

4 verbose run-script [ ‘prestart’, ‘start’, ‘poststart’ ]

5 info lifecycle smartadmin@0.5.0~prestart: smartadmin@0.5.0

6 info lifecycle smartadmin@0.5.0~start: smartadmin@0.5.0

7 verbose lifecycle smartadmin@0.5.0~start: unsafe-perm in lifecycle true

8 verbose lifecycle smartadmin@0.5.0~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\sistemas\angular\Kcms.Erp.Web\node_modules.bin;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Git\cmd;C:\Program Files\PuTTY;C:\Program Files\nodejs;C:\Program Files\Azure Data Studio\bin;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\150\Tools\Binn;C:\Program Files\Microsoft SQL Server\150\Tools\Binn;C:\Program Files\Microsoft SQL Server\150\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn;C:\maven\apache-maven-3.6.3\bin;C:\Program Files\Java\jdk-11.0.8;C:\Users\guilh\AppData\Local\Microsoft\WindowsApps;C:\Users\guilh\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\guilh\AppData\Roaming\npm;C:\Program Files\Azure Data Studio\bin;

9 verbose lifecycle smartadmin@0.5.0~start: CWD: C:\sistemas\angular\Kcms.Erp.Web

10 silly lifecycle smartadmin@0.5.0~start: Args: [ ‘/d /s /c’, ‘ng serve’ ]

11 silly lifecycle smartadmin@0.5.0~start: Returned: code: 1 signal: null

12 info lifecycle smartadmin@0.5.0~start: Failed to exec start script

13 verbose stack Error: smartadmin@0.5.0 start: ng serve

13 verbose stack Exit status 1

13 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)

13 verbose stack at EventEmitter.emit (events.js:315:20)

13 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)

13 verbose stack at ChildProcess.emit (events.js:315:20)

13 verbose stack at maybeClose (internal/child_process.js:1021:16)

13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)

14 verbose pkgid smartadmin@0.5.0

15 verbose cwd C:\sistemas\angular\Kcms.Erp.Web

16 verbose Windows_NT 10.0.19041

17 verbose argv “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js” “start”

18 verbose node v12.18.3

19 verbose npm v6.14.6

20 error code ELIFECYCLE

21 error errno 1

22 error smartadmin@0.5.0 start: ng serve

22 error Exit status 1

23 error Failed at the smartadmin@0.5.0 start script.

23 error This is probably not a problem with npm. There is likely additional logging output above.

24 verbose exit [ 1, true ]

Opa, eae cara, blz?

Nunca tive esse erro (bom, mas uso angular somente em projetos pessoais mesmo, raramente mexo em coisas muito elaboradas).

Como está o seu package.json? Veja em qual versão o typescript está declarado nele. E teste com uma versão abaixo da 4.3.0 e maior que 4.2.3.

1 curtida

Funcionou com este “typescript”: “4.2.4”,

Agora voltou para este erro: Npm start - angular 12

1 curtida