Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@nrwl/nx workspace - npm ERR! Failed at the @1.146.0 format script #960

Closed
YonatanKra opened this issue Dec 19, 2018 · 2 comments
Closed
Labels

Comments

@YonatanKra
Copy link

I've converted an angular-cli project into a @nrwl/nx project via the ng add @nrwl/schematics command.
When running ng g app appName the generator starts, creates the files but throws errors:
Error 1:

[error] apps\app-name\app-name\src\app\app.component.html: SyntaxError: Expected corresponding JSX closing tag for <img> (5:1)
[error]   3 |   <h1>Welcome to {{title}}!</h1>
[error]   4 |   <img width="300" src="https://raw.githubusercontent.com/nrwl/nx/master/nx-logo.png">
[error] > 5 | </div>
[error]     | ^
[error]   6 |
[error]   7 | <h2>This is an Angular CLI app built with Nrwl Nx!</h2>
[error]   8 |

Error 2:

[error] apps\app-name\app-name\src\index.html: SyntaxError: Unexpected token (1:2)
[error] > 1 | <!doctype html>
[error]     |  ^
[error]   2 | <html lang="en">
[error]   3 | <head>
[error]   4 |   <meta charset="utf-8">

Error 3:

C:\projects\WM.editor\node_modules\@nrwl\schematics\node_modules\yargs\yargs.js:1133
      else throw err
           ^

Error: Command failed: node "C:\projects\WM.editor\node_modules\prettier\bin-prettier.js" --write apps/wm-common/
wm-common-e2e/protractor.conf.js apps/wm-common/wm-common-e2e/src/app.e2e-spec.ts apps/wm-common/wm-common-e2e/sr
c/app.po.ts apps/wm-common/wm-common-e2e/tsconfig.e2e.json apps/wm-common/wm-common/karma.conf.js apps/wm-common/
wm-common/src/app/app.component.css apps/wm-common/wm-common/src/app/app.component.html apps/wm-common/wm-common/
src/app/app.component.spec.ts apps/wm-common/wm-common/src/app/app.component.ts apps/wm-common/wm-common/src/app/
app.module.ts apps/wm-common/wm-common/src/environments/environment.prod.ts apps/wm-common/wm-common/src/environm
ents/environment.ts apps/wm-common/wm-common/src/index.html apps/wm-common/wm-common/src/main.ts apps/wm-common/w
m-common/src/polyfills.ts apps/wm-common/wm-common/src/styles.css apps/wm-common/wm-common/src/test.ts apps/wm-co
mmon/wm-common/tsconfig.app.json apps/wm-common/wm-common/tsconfig.spec.json apps/wm-common/wm-common/tslint.json
    at checkExecSyncError (child_process.js:574:11)
    at Object.execSync (child_process.js:611:13)
    at write (C:\projects\WM.editor\node_modules\@nrwl\schematics\src\command-line\format.js:67:25)
    at C:\projects\WM.editor\node_modules\@nrwl\schematics\src\command-line\format.js:21:57
    at Array.forEach (<anonymous>)
    at Object.format (C:\projects\WM.editor\node_modules\@nrwl\schematics\src\command-line\format.js:21:23)
    at Object.handler (C:\projects\WM.editor\node_modules\@nrwl\schematics\src\command-line\nx.js:51:115)
    at Object.runCommand (C:\projects\WM.editor\node_modules\@nrwl\schematics\node_modules\yargs\lib\command.js:2
35:44)
    at Object.parseArgs [as _parseArgs] (C:\projects\WM.editor\node_modules\@nrwl\schematics\node_modules\yargs\y
args.js:1046:30)
    at Object.get [as argv] (C:\projects\WM.editor\node_modules\@nrwl\schematics\node_modules\yargs\yargs.js:989:
21)

Steps to Reproduce

  1. Had an existing angular-cli project
  2. ng add @nrwl/schematics
  3. An apps folder was created
  4. Made sure builds and tests pass
  5. Add an app using ng g app
  6. The error occurred

Angular versions:

Angular CLI: 7.1.3
Node: 9.4.0
OS: win32 x64
Angular: 7.1.3
... animations, cli, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router, upgrade

Package Version

@angular-devkit/architect 0.11.3
@angular-devkit/build-angular 0.11.3
@angular-devkit/build-optimizer 0.11.3
@angular-devkit/build-webpack 0.11.3
@angular-devkit/core 7.1.3
@angular-devkit/schematics 7.1.3
@ngtools/webpack 7.1.3
@schematics/angular 7.1.3
@schematics/update 0.11.3
rxjs 6.3.3
typescript 3.1.6
webpack 4.23.1

Failure Logs

0 info it worked if it ends with ok
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   'format',
1 verbose cli   '--',
1 verbose cli   '--untracked',
1 verbose cli   '--quiet' ]
2 info using npm@5.6.0
3 info using node@v9.4.0
4 verbose run-script [ 'preformat', 'format', 'postformat' ]
5 info lifecycle @1.146.0~preformat: @1.146.0
6 info lifecycle @1.146.0~format: @1.146.0
7 verbose lifecycle @1.146.0~format: unsafe-perm in lifecycle true
8 verbose lifecycle @1.146.0~format: PATH: C:\Tools\nvm\v9.4.0\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\projects\WM.editor\node_modules\.bin;C:\Users\yonatan.kr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\yonatan.kr\bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Microsoft\Web Platform Installer;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0;C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;C:\Users\yonatan.kr\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files (x86)\Skype\Phone;C:\Users\yonatan.kr\AppData\Roaming\npm;C:\Tools\nvm;C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\;C:\Tools\nvm;C:\Program Files\nodejs;C:\Program Files (x86)\Git\cmd;C:\Program Files (x86)\GitExtensions;C:\ProgramData\chocolatey\bin;C:\Android\android-sdk\tools;C:\Android\android-sdk\platform-tools;C:\Android\android-sdk\tools\bin;C:\Program Files\Java\jdk1.8.0_172\bin;C:\Program Files\Amazon\AWSCLI;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Ruby24-x64\bin;C:\Ruby200-x64\bin;C:\Users\yonatan.kr\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Microsoft VS Code\bin;C:\Users\yonatan.kr\AppData\Local\Yarn\bin;C:\Program Files\nodejs;C:\Tools\nvm;C:\Program Files\nodejs;C:\Program Files\Docker Toolbox;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;%DASHLANE_DLL_DIR%;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl
9 verbose lifecycle @1.146.0~format: CWD: C:\projects\WM.editor
10 silly lifecycle @1.146.0~format: Args: [ '/d /s /c', 'nx format:write "--untracked" "--quiet"' ]
11 silly lifecycle @1.146.0~format: Returned: code: 1  signal: null
12 info lifecycle @1.146.0~format: Failed to exec format script
13 verbose stack Error: @1.146.0 format: `nx format:write "--untracked" "--quiet"`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Tools\nvm\v9.4.0\node_modules\npm\node_modules\npm-lifecycle\index.js:285:16)
13 verbose stack     at EventEmitter.emit (events.js:160:13)
13 verbose stack     at ChildProcess.<anonymous> (C:\Tools\nvm\v9.4.0\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:160:13)
13 verbose stack     at maybeClose (internal/child_process.js:943:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
14 verbose pkgid @1.146.0
15 verbose cwd C:\projects\WM.editor
16 verbose Windows_NT 10.0.15063
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "format" "--" "--untracked" "--quiet"
18 verbose node v9.4.0
19 verbose npm  v5.6.0
20 error code ELIFECYCLE
21 error errno 1
22 error @1.146.0 format: `nx format:write "--untracked" "--quiet"`
22 error Exit status 1
23 error Failed at the @1.146.0 format script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Can anyone tell what might be the problem?

@YonatanKra YonatanKra changed the title @nrwl/nx workspace - error when creating a new app @nrwl/nx workspace - npm ERR! Failed at the @1.146.0 format script Dec 19, 2018
@YonatanKra
Copy link
Author

The problem was an old prettier version (need >=1.15.x).

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant