nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.04k stars 2.3k forks source link

Can't upgrade from nx 7 to nx 8 if tslint.json has comments or doesn't have rules directory section #1491

Closed sdurnov closed 5 years ago

sdurnov commented 5 years ago

Please make sure you have read the submission guidelines before posting an issue

Expected Behavior

Upgrade should go fine regardless of tslint.json content

Current Behavior

I'm getting an error during post-install phase:

Cannot read property 'map' of undefined if rulesDirectory is missing from tslint.json

if there are comments in tslint.json, it gives an exception about error while parcing a json file

Failure Information (for bugs)

Full log of running update command:

$ npm run update

emsys@0.0.0 update \Documents\Repository\emsysui\sems-web ng update @nrwl/schematics

Updating package.json with dependency @nrwl/schematics @ "8.1.0" (was "7.6.2")...

UPDATE package.json (5587 bytes) npm WARN @nrwl/nx@7.6.2 requires a peer of jasmine-marbles@0.4.0 but none is installed. You must install peer dependencies yourself. npm WARN ngrx-data@6.1.0-beta.3 requires a peer of @ngrx/effects@^6.0.0 but none is installed. You must install peer dependencies yourself. npm WARN ngrx-data@6.1.0-beta.3 requires a peer of @ngrx/entity@^6.0.0 but none is installed. You must install peer dependencies yourself. npm WARN ngrx-data@6.1.0-beta.3 requires a peer of @ngrx/store@^6.0.0 but none is installed. You must install peer dependencies yourself. npm WARN tsickle@0.34.3 requires a peer of typescript@~3.3.1 but none is installed. You must install peer dependencies yourself. npm WARN tsutils-etc@1.1.0 requires a peer of tsutils@^3.0.0 but none is installed. You must install peer dependencies yourself. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

added 44 packages from 18 contributors, removed 1 package, updated 1 package and audited 86770 packages in 23.896s found 63 vulnerabilities (62 low, 1 high) run npm audit fix to fix them, or npm audit for details Prettier has been updated to 1.16.4 which has a lot of small improvements Formatting of your code might change as you are working on each file. Prettier will now format .less files you can disable this by adding '.less' to your .prettierignore

        Optional: You may want to run "npm run format" as part of this update to reformat all files in your workspace.

        You can also opt out of formatting in files by adding them to the .prettierignore file in the root of your workspace.
        Nx has been repackaged. We are installing and migrating your dependencies to the ones necessary.

        If you have workspace schematics, we tried to migrate your imports from "@nrwl/schematics" to "@nrwl/workspace" but your externalSchematics may be broken.

        Read this guide to see where to find familiar features: https://nx.dev/guides/nx7-to-nx8

        This migration may take a few minutes.
        Removing @nrwl/schematics as a dependency
        Removing @nrwl/builders as a dependency
        Removing @nrwl/nx as a dependency

Cannot read property 'map' of undefined npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! emsys@0.0.0 update: ng update @nrwl/schematics npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the emsys@0.0.0 update 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! \AppData\Roaming\npm-cache_logs\2019-06-14T14_45_27_811Z-debug.log

And here is npm debug 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   'run',
1 verbose cli   'update'
1 verbose cli ]
2 info using npm@6.9.0
3 info using node@v12.4.0
4 verbose run-script [ 'preupdate', 'update', 'postupdate' ]
5 info lifecycle emsys@0.0.0~preupdate: emsys@0.0.0
6 info lifecycle emsys@0.0.0~update: emsys@0.0.0
7 verbose lifecycle emsys@0.0.0~update: unsafe-perm in lifecycle true
8 verbose lifecycle emsys@0.0.0~update: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\SDURNOV\Documents\Repository\emsysui\sems-web\node_modules\.bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\SDURNOV\bin;C:\Python27;C:\Python27\Scripts;C:\ProgramData\Boxstarter;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\dotnet;C:\WINDOWS\System32\OpenSSH;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\Git\cmd;C:\ProgramData\chocolatey\bin;C:\Program Files\nodejs;C:\Users\SDURNOV\AppData\Local\Microsoft\WindowsApps;C:\Users\SDURNOV.S1INCD\.dotnet\tools;C:\Users\SDURNOV\AppData\Roaming\npm
9 verbose lifecycle emsys@0.0.0~update: CWD: C:\Users\SDURNOV\Documents\Repository\emsysui\sems-web
10 silly lifecycle emsys@0.0.0~update: Args: [ '/d /s /c', 'ng update @nrwl/schematics' ]
11 silly lifecycle emsys@0.0.0~update: Returned: code: 1  signal: null
12 info lifecycle emsys@0.0.0~update: Failed to exec update script
13 verbose stack Error: emsys@0.0.0 update: `ng update @nrwl/schematics`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:200:13)
13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:200:13)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid emsys@0.0.0
15 verbose cwd C:\Users\SDURNOV\Documents\Repository\emsysui\sems-web
16 verbose Windows_NT 10.0.17134
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "update"
18 verbose node v12.4.0
19 verbose npm  v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error emsys@0.0.0 update: `ng update @nrwl/schematics`
22 error Exit status 1
23 error Failed at the emsys@0.0.0 update script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. Installed latest versions of @angular/cli @nrwl/schematics and @ngrx/schematics globally
  2. Removed node_modules and package-lock.json locally
  3. Performed npm install locally
  4. Launched npm run update script

Context

Please provide any relevant information about your setup:

FrozenPandaz commented 5 years ago

This was fixed with https://github.com/nrwl/nx/commit/1748ac9e9c1d133b0848eca4aeccbd8f2e91321d.

It will be in the next release 😄

sdurnov commented 5 years ago

@FrozenPandaz as far as I see, this commit fixes only comments issue, but not rulesDirectory issue.

github-actions[bot] commented 1 year ago

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.