electron-userland / electron-forge-templates

Templates bundled with Electron Forge <= 5 to create Electron apps using popular JavaScript frameworks
107 stars 23 forks source link

electron-forge lint error #48

Closed nrlquaker closed 7 years ago

nrlquaker commented 7 years ago

Please describe your issue: After init project with react+typescript template lint gives an error.

*Console output when you run electron-forge init with the environment variable `DEBUG=electron-forge:`. (Instructions on how to do so here). Please include the stack trace if one exists.**

WARNING: DEBUG environment variable detected.  Progress indicators will be sent over electron-forge:lifecycle
  electron-forge:lifecycle Process Started: Checking your system +0ms
  electron-forge:lifecycle Process Succeeded: Checking your system +446ms
  electron-forge:runtime-config setting key: verbose to value: false +0ms
WARNING: DEBUG environment variable detected.  Progress indicators will be sent over electron-forge:lifecycle
  electron-forge:init Initializing in: /Users/me/Projects/my-new-project +0ms
  electron-forge:lifecycle Process Started: Initializing Project Directory +0ms
  electron-forge:init:directory creating directory: /Users/me/Projects/my-new-project +0ms
  electron-forge:lifecycle Process Succeeded: Initializing Project Directory +3ms
  electron-forge:lifecycle Process Started: Initializing Git Repository +1ms
  electron-forge:init:git executing "git init" in directory: /Users/me/Projects/my-new-project +0ms
  electron-forge:lifecycle Process Succeeded: Initializing Git Repository +15ms
  electron-forge:lifecycle Process Started: Copying Starter Files +1ms
  electron-forge:init:starter-files creating directory: /Users/me/Projects/my-new-project/src +0ms
  electron-forge:init:starter-files copying "/usr/local/lib/node_modules/electron-forge/tmpl/_gitignore" --> "/Users/me/Projects/my-new-project/.gitignore" +0ms
  electron-forge:init:starter-files copying "/usr/local/lib/node_modules/electron-forge/tmpl/_compilerc" --> "/Users/me/Projects/my-new-project/.compilerc" +5ms
  electron-forge:init:starter-files copying "/usr/local/lib/node_modules/electron-forge/tmpl/index.js" --> "/Users/me/Projects/my-new-project/src/index.js" +1ms
  electron-forge:init:starter-files copying "/usr/local/lib/node_modules/electron-forge/tmpl/index.html" --> "/Users/me/Projects/my-new-project/src/index.html" +1ms
  electron-forge:lifecycle Process Succeeded: Copying Starter Files +8ms
  electron-forge:lifecycle Process Started: Initializing NPM Module +1ms
  electron-forge:init:npm writing package.json to: /Users/me/Projects/my-new-project +0ms
  electron-forge:lifecycle Process Succeeded: Initializing NPM Module +7ms
  electron-forge:lifecycle Process Started: Installing NPM Dependencies +0ms
  electron-forge:init:npm installing dependencies +2ms
  electron-forge:dependency-installer installing ["electron-compile"] in: /Users/me/Projects/my-new-project dev=false,exact=false,withYarn=false +0ms
  electron-forge:dependency-installer executing ["install","electron-compile","--save"] in: /Users/me/Projects/my-new-project +0ms
  electron-forge:runtime-config fetching key verbose +0ms
  electron-forge:init:npm installing devDependencies +4s
  electron-forge:dependency-installer installing ["babel-preset-env","babel-preset-react","babel-plugin-transform-async-to-generator","electron-forge"] in: /Users/me/Projects/my-new-project dev=true,exact=false,withYarn=false +4s
  electron-forge:dependency-installer executing ["install","babel-preset-env","babel-preset-react","babel-plugin-transform-async-to-generator","electron-forge","--save-dev"] in: /Users/me/Projects/my-new-project +0ms
  electron-forge:runtime-config fetching key verbose +4s
  electron-forge:init:npm installing exact dependencies +15s
  electron-forge:dependency-installer installing ["electron-prebuilt-compile"] in: /Users/me/Projects/my-new-project dev=true,exact=true,withYarn=false +15s
  electron-forge:dependency-installer executing ["install","electron-prebuilt-compile","--save-exact","--save-dev"] in: /Users/me/Projects/my-new-project +0ms
  electron-forge:runtime-config fetching key verbose +15s
  electron-forge:init:npm not installing linting deps +10s
  electron-forge:lifecycle Process Succeeded: Installing NPM Dependencies +29s
  electron-forge:lifecycle Process Started: Locating custom template: "react-typescript" +1ms
  electron-forge:init:custom using local template +0ms
  electron-forge:lifecycle Process Succeeded: Locating custom template: "react-typescript" +3ms
  electron-forge:lifecycle Process Started: Installing Template Dependencies +0ms
  electron-forge:init:custom installing dependencies +1ms
  electron-forge:dependency-installer installing ["react@^15.4.1","react-dom@^15.4.1","@types/electron@^1.4.30","@types/react@^0.14.55","@types/react-dom@^0.14.20","@types/electron-devtools-installer@^2.0.2","electron-devtools-installer@^2.0.1","react-hot-loader@^3.0.0-beta.6","tslib@^1.4.0"] in: /Users/me/Projects/my-new-project dev=false,exact=false,withYarn=false +10s
  electron-forge:dependency-installer executing ["install","react@^15.4.1","react-dom@^15.4.1","@types/electron@^1.4.30","@types/react@^0.14.55","@types/react-dom@^0.14.20","@types/electron-devtools-installer@^2.0.2","electron-devtools-installer@^2.0.1","react-hot-loader@^3.0.0-beta.6","tslib@^1.4.0","--save"] in: /Users/me/Projects/my-new-project +0ms
  electron-forge:runtime-config fetching key verbose +10s
  electron-forge:init:custom installing devDependencies +9s
  electron-forge:dependency-installer installing ["tslint@^5.1.0","typescript@~2.2.2"] in: /Users/me/Projects/my-new-project dev=true,exact=false,withYarn=false +9s
  electron-forge:dependency-installer executing ["install","tslint@^5.1.0","typescript@~2.2.2","--save-dev"] in: /Users/me/Projects/my-new-project +0ms
  electron-forge:runtime-config fetching key verbose +9s
  electron-forge:lifecycle Process Succeeded: Installing Template Dependencies +14s
  electron-forge:lifecycle Process Started: Copying Template Files +0ms
  electron-forge:init:starter-files copying "/usr/local/lib/node_modules/electron-forge/node_modules/electron-forge-template-react-typescript/tmpl/_compilerc" --> "/Users/me/Projects/my-new-project/.compilerc" +44s
  electron-forge:init:starter-files copying "/usr/local/lib/node_modules/electron-forge/node_modules/electron-forge-template-react-typescript/tmpl/src/app.tsx" --> "/Users/me/Projects/my-new-project/src/app.tsx" +3ms
  electron-forge:init:starter-files copying "/usr/local/lib/node_modules/electron-forge/node_modules/electron-forge-template-react-typescript/tmpl/src/index.html" --> "/Users/me/Projects/my-new-project/src/index.html" +1ms
  electron-forge:init:starter-files copying "/usr/local/lib/node_modules/electron-forge/node_modules/electron-forge-template-react-typescript/tmpl/src/index.ts" --> "/Users/me/Projects/my-new-project/src/index.ts" +1ms
  electron-forge:init:starter-files copying "/usr/local/lib/node_modules/electron-forge/node_modules/electron-forge-template-react-typescript/tmpl/tsconfig.json" --> "/Users/me/Projects/my-new-project/tsconfig.json" +1ms
  electron-forge:init:starter-files copying "/usr/local/lib/node_modules/electron-forge/node_modules/electron-forge-template-react-typescript/tmpl/tslint.json" --> "/Users/me/Projects/my-new-project/tslint.json" +1ms
  electron-forge:lifecycle Process Succeeded: Copying Template Files +24ms

What command line arguments are you passing?

electron-forge init my-new-project --template=react-typescript

What does your config.forge data in package.json look like?

    "config": {
    "forge": {
      "make_targets": {
        "win32": [
          "squirrel"
        ],
        "darwin": [
          "zip"
        ],
        "linux": [
          "deb",
          "rpm"
        ]
      },
      "electronPackagerConfig": {
        "packageManager": "npm"
      },
      "electronWinstallerConfig": {
        "name": "my_new_project"
      },
      "electronInstallerDebian": {},
      "electronInstallerRedhat": {},
      "github_repository": {
        "owner": "",
        "name": ""
      },
      "windowsStoreConfig": {
        "packageName": "",
        "name": "mynewproject"
      }
    }
  },

Please provide either a failing minimal testcase (with a link to the code) or detailed steps to reproduce your problem.

Steps to reproduce: 1 . electron-forge init my-new-project --template=react-typescript

  1. cd my-new-project
  2. electron-forge lint
WARNING: DEBUG environment variable detected.  Progress indicators will be sent over electron-forge:lifecycle
  electron-forge:lifecycle Process Started: Checking your system +0ms
  electron-forge:lifecycle Process Succeeded: Checking your system +432ms
  electron-forge:runtime-config setting key: verbose to value: false +0ms
WARNING: DEBUG environment variable detected.  Progress indicators will be sent over electron-forge:lifecycle
  electron-forge:lifecycle Process Started: Linting Application +0ms
  electron-forge:project-resolver searching for project in: /Users/me/Projects/my-new-project +0ms
  electron-forge:project-resolver electron-forge compatible package.json found in /Users/me/Projects/my-new-project/package.json +4ms
  electron-forge:lint executing "run lint -- --color" in dir: /Users/me/Projects/my-new-project +0ms
  electron-forge:lifecycle Process Failed: Linting Application +1s
  electron-forge:lifecycle Process Succeeded: Linting Application +1ms

An unhandled rejection has occurred inside Forge:

> my-new-project@1.0.0 lint /Users/me/Projects/my-new-project
> tslint --project tsconfig.json --type-check --force "--color"

  error: unknown option `--color'

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-new-project@1.0.0 lint: `tslint --project tsconfig.json --type-check --force "--color"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-new-project@1.0.0 lint 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!     /Users/me/.npm/_logs/2017-09-08T11_49_06_553Z-debug.log

Failed with exit code: 1
Error:
> my-new-project@1.0.0 lint /Users/me/Projects/my-new-project
> tslint --project tsconfig.json --type-check --force "--color"

  error: unknown option `--color'

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-new-project@1.0.0 lint: `tslint --project tsconfig.json --type-check --force "--color"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-new-project@1.0.0 lint 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!     /Users/me/.npm/_logs/2017-09-08T11_49_06_553Z-debug.log

Failed with exit code: 1
    at SafeSubscriber._error (/usr/local/lib/node_modules/electron-forge/node_modules/spawn-rx/lib/src/index.js:267:84)
    at SafeSubscriber.__tryOrUnsub (/usr/local/lib/node_modules/electron-forge/node_modules/rxjs/Subscriber.js:238:16)
    at SafeSubscriber.error (/usr/local/lib/node_modules/electron-forge/node_modules/rxjs/Subscriber.js:197:26)
    at Subscriber._error (/usr/local/lib/node_modules/electron-forge/node_modules/rxjs/Subscriber.js:128:26)
    at Subscriber.error (/usr/local/lib/node_modules/electron-forge/node_modules/rxjs/Subscriber.js:102:18)
    at MapSubscriber.Subscriber._error (/usr/local/lib/node_modules/electron-forge/node_modules/rxjs/Subscriber.js:128:26)
    at MapSubscriber.Subscriber.error (/usr/local/lib/node_modules/electron-forge/node_modules/rxjs/Subscriber.js:102:18)
    at SafeSubscriber._next (/usr/local/lib/node_modules/electron-forge/node_modules/spawn-rx/lib/src/index.js:241:65)
    at SafeSubscriber.__tryOrUnsub (/usr/local/lib/node_modules/electron-forge/node_modules/rxjs/Subscriber.js:238:16)
    at SafeSubscriber.next (/usr/local/lib/node_modules/electron-forge/node_modules/rxjs/Subscriber.js:185:22)
    at Subscriber._next (/usr/local/lib/node_modules/electron-forge/node_modules/rxjs/Subscriber.js:125:26)
    at Subscriber.next (/usr/local/lib/node_modules/electron-forge/node_modules/rxjs/Subscriber.js:89:18)
    at ReduceSubscriber._complete (/usr/local/lib/node_modules/electron-forge/node_modules/rxjs/operator/reduce.js:119:30)
    at ReduceSubscriber.Subscriber.complete (/usr/local/lib/node_modules/electron-forge/node_modules/rxjs/Subscriber.js:114:18)
    at MergeAllSubscriber.notifyComplete (/usr/local/lib/node_modules/electron-forge/node_modules/rxjs/operator/mergeAll.js:105:30)
    at InnerSubscriber._complete (/usr/local/lib/node_modules/electron-forge/node_modules/rxjs/InnerSubscriber.js:30:21)

2017-09-08T11_49_06_553Z-debug.log:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/8.4.0/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'run',
1 verbose cli   'lint',
1 verbose cli   '--',
1 verbose cli   '--color' ]
2 info using npm@5.4.0
3 info using node@v8.4.0
4 verbose run-script [ 'prelint', 'lint', 'postlint' ]
5 info lifecycle my-new-project@1.0.0~prelint: my-new-project@1.0.0
6 info lifecycle my-new-project@1.0.0~lint: my-new-project@1.0.0
7 verbose lifecycle my-new-project@1.0.0~lint: unsafe-perm in lifecycle true
8 verbose lifecycle my-new-project@1.0.0~lint: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/me/Projects/my-new-project/node_modules/.bin:/Users/me/Library/Android/sdk/platform-tools:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
9 verbose lifecycle my-new-project@1.0.0~lint: CWD: /Users/me/Projects/my-new-project
10 silly lifecycle my-new-project@1.0.0~lint: Args: [ '-c',
10 silly lifecycle   'tslint --project tsconfig.json --type-check --force "--color"' ]
11 silly lifecycle my-new-project@1.0.0~lint: Returned: code: 1  signal: null
12 info lifecycle my-new-project@1.0.0~lint: Failed to exec lint script
13 verbose stack Error: my-new-project@1.0.0 lint: `tslint --project tsconfig.json --type-check --force "--color"`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:280:16)
13 verbose stack     at emitTwo (events.js:125:13)
13 verbose stack     at EventEmitter.emit (events.js:213:7)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at emitTwo (events.js:125:13)
13 verbose stack     at ChildProcess.emit (events.js:213:7)
13 verbose stack     at maybeClose (internal/child_process.js:927:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
14 verbose pkgid my-new-project@1.0.0
15 verbose cwd /Users/me/Projects/my-new-project
16 verbose Darwin 16.7.0
17 verbose argv "/usr/local/Cellar/node/8.4.0/bin/node" "/usr/local/bin/npm" "run" "lint" "--" "--color"
18 verbose node v8.4.0
19 verbose npm  v5.4.0
20 error code ELIFECYCLE
21 error errno 1
22 error my-new-project@1.0.0 lint: `tslint --project tsconfig.json --type-check --force "--color"`
22 error Exit status 1
23 error Failed at the my-new-project@1.0.0 lint script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
malept commented 7 years ago

Looks like Forge itself is calling all linters with an extra --color argument. @MarshallOfSound should we move the arg to the scripts call or remove it entirely?

malept commented 7 years ago

Fixed in Electron Forge 4.0.2, thanks for reporting.