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

Warning: Path must be a string. Received null Use --force to continue #2922

Closed
xtianus79 opened this issue May 3, 2016 · 12 comments · Fixed by globalizejs/globalize#667 or dsmorse/gridster.js#88

Comments

@xtianus79
Copy link

xtianus79 commented May 3, 2016

The path seems correct and I even went root to root and it is still giving this error.

when I run -v it is

outputing this:

options: force=false, reporterOutput=null, jshintrc="client/.jshintrc", reporter="/theAppHere/node_modules/jshint-stylish/stylish.js"
Warning: Path must be a string. Received null Use --force to continue.

Update:

Just to add... this is happening since upgrading from 5.11 to 6.0

@MrSwitch
Copy link

MrSwitch commented May 9, 2016

What version of jshint are you using? I received this error when using v2.5, but not the latest, v2.9.2.

FYI: i was using it through grunt-contrib-jshint (and updated that to resolve this error)

@xtianus79
Copy link
Author

@MrSwitch my jshint is jshint v2.9.2

@jeffpeck-intellify
Copy link

I am having the same issue, using jshint v2.9.2

@jeffpeck-intellify
Copy link

I have found the issue to be when the reporterOutput option is set to null. If you change that option to refer to an empty string, jshint will work as expected:

options: {
      jshintrc: '<%= baseDir %>/.jshintrc',
      reporterOutput: "",
      ...

@ghost
Copy link

ghost commented May 16, 2016

Explicitly setting "reporterOutput" fixed the warning in travis-ci build in my case. Thanks.

@shershen08
Copy link

"options": { "jshintrc": "<%= baseDir %>.jshintrc",
worked for me, mind no slash "/" after <%= baseDir %>

@jugglinmike
Copy link
Member

This looks to me like an issue with the Grunt plugin, not JSHint itself. Can anyone who has responded so far demonstrate this problem using JSHint without the plugin?

@coryasilva
Copy link

coryasilva commented Jun 24, 2016

I do not have this problem with the latest gulp packages (as of 2016-06-18), but opened an older project today with grunt and observed this issue. Thanks to @jeffpeck-intellify for the work around; you saved me some time today!

marcandre added a commit to noelboss/featherlight that referenced this issue Jun 27, 2016
timdream added a commit to timdream/wordcloud2.js that referenced this issue Jul 12, 2016
Do not upgrade jshint because of false negative "unused variable" errors.
Lekensteyn added a commit to CodeYellowBV/node-esl that referenced this issue Aug 2, 2016
Fixes failing `grunt jshint` task:

    Running "jshint:lib" (jshint) task
    Verifying property jshint.lib exists in config...OK
    Files: lib/esl/Connection.js, lib/esl/Event.js, lib/esl/Parser.js, lib/esl/Server.js, lib/esl/esl.js, lib/index.js
    Options: force=false, reporterOutput=null, jshintrc=".jshintrc"
    Warning: Path must be a string. Received null Use --force to continue.

    Aborted due to warnings.

Likely fixed by
gruntjs/grunt-contrib-jshint@a0cd3db
which was needed due to a newer jshint version, see
jshint/jshint#2922

After the upgrade, have to disable a camelcase warning (W106) that
cannot be fixed since it is part of the interface. This also silences
some deprecation warnings in newer node versions.
@Lekensteyn
Copy link

@jugglinmike If I may guess, it is fixed in grunt-contrib-jshint via gruntjs/grunt-contrib-jshint@a0cd3db.

jonathanstegall added a commit to MinnPost/minnpost-elections-dashboard that referenced this issue Aug 4, 2016
mglaman added a commit to mglaman/dreditor that referenced this issue Aug 23, 2016
Was throwing "Warning: Path must be a string. Received null Use --force
to continue." See jshint/jshint#2922

Also move shared jshintrc into root options.
@jarimbi
Copy link

jarimbi commented Oct 7, 2016

Thanks for much for the tip of 'reporterOutput: "",'
I had no clue what was going wrong!

copperwall added a commit to iFixit/pulldasher that referenced this issue Oct 23, 2016
An issue was filed on jshint's github about this
jshint/jshint#2922. The solution seems to be to
explicitly define a reporterOutput option with a value of empty string.

After making this change, grunt builds ran flawlessly.
copperwall added a commit to iFixit/pulldasher that referenced this issue Oct 23, 2016
Fix null error in jshint grunt plugin

An issue was filed on jshint's github about this
jshint/jshint#2922. The solution seems to be to
explicitly define a reporterOutput option with a value of empty string.

After making this change, grunt builds ran flawlessly.
LordPachelbel added a commit to LordPachelbel/grunt-init-gruntfile that referenced this issue Oct 26, 2016
adamchainz pushed a commit to adamchainz/django-grappelli that referenced this issue Oct 31, 2016
After a fresh install I got:

```
$ node_modules/.bin/grunt javascripts
Running "javascripts" task

Running "concat:dist" (concat) task
File grappelli/static/grappelli/js/grappelli.min.js created.

Running "jshint:afterconcat" (jshint) task
Warning: Path must be a string. Received null Use --force to continue.

Aborted due to warnings.
```

This is a known issue, with this fix: jshint/jshint#2922 (comment)
adamchainz pushed a commit to adamchainz/django-grappelli that referenced this issue Oct 31, 2016
After a fresh install I got:

```
$ node_modules/.bin/grunt javascripts
Running "javascripts" task

Running "concat:dist" (concat) task
File grappelli/static/grappelli/js/grappelli.min.js created.

Running "jshint:afterconcat" (jshint) task
Warning: Path must be a string. Received null Use --force to continue.

Aborted due to warnings.
```

This is a known issue, with this fix: jshint/jshint#2922 (comment)
@flyher
Copy link

flyher commented Jun 28, 2017

After i update the grunt-contrib-jshint from version 0.9 to 1.0, the bug fixed.
my node version: 6.0 and i test it in node version 5.0.
This table is my record.

node version grunt-contrib-jshint grunt dev error code
4.4.3 ~0.9.2 success
6.11 ~0.9.2 build failed Warning: Path must be a string. Received null Use --force to continue
6.11 ~1.1.0 success

@jugglinmike
Copy link
Member

At this point, it seems fairly conclusive that this problem is with the
grunt-contrib-jshint module. Happily, this has been resolved in recent
versions, and for those who can't upgrade just yet, the comments above have
some ideas for workarounds. Thanks, all.

sualko added a commit to sualko/otr that referenced this issue Sep 19, 2017
Without this fix, I received "Warning: Path must be a string", see jshint/jshint#2922
pcraig3 added a commit to alphagov/spotlight that referenced this issue Sep 20, 2017
Updating the node version broke jshint for some reason, but
fortunately not very badly.

Found the relevant fix here: jshint/jshint#2922 (comment)

With jshint working again, I went back and fixed some of the
syntax errors I'd introduced.
pcraig3 added a commit to alphagov/spotlight that referenced this issue Oct 5, 2017
Updating the node version broke jshint for some reason, but
fortunately not very badly.

Found the relevant fix here: jshint/jshint#2922 (comment)

With jshint working again, I went back and fixed some of the
syntax errors I'd introduced.
arlolra pushed a commit to arlolra/otr that referenced this issue Oct 10, 2017
Without this fix, I received "Warning: Path must be a string", see jshint/jshint#2922
pcraig3 added a commit to alphagov/spotlight that referenced this issue Oct 12, 2017
Updating the node version broke jshint for some reason, but
fortunately not very badly.

Found the relevant fix here: jshint/jshint#2922 (comment)

With jshint working again, I went back and fixed some of the
syntax errors I'd introduced.
pcraig3 added a commit to alphagov/spotlight that referenced this issue Oct 12, 2017
Updating the node version broke jshint for some reason, but
fortunately not very badly.

Found the relevant fix here: jshint/jshint#2922 (comment)

With jshint working again, I went back and fixed some of the
syntax errors I'd introduced.
mtrias added a commit to VividCortex/grunt-circleci that referenced this issue Oct 21, 2017
anttikuuskoski added a commit to anttikuuskoski/select2 that referenced this issue Feb 23, 2018
See jshint/jshint#2922

> Running "jshint:code" (jshint) task
> Warning: Path must be a string. Received null Use --force to continue.
>
> Aborted due to warnings.
davious added a commit to NCARB/StyleGuide that referenced this issue Apr 30, 2018
davious added a commit to NCARB/StyleGuide that referenced this issue May 2, 2018
* feat(travis): travis

* node ^6 package.json

* chrome launcher

* Gruntfile: reporterOutpu: ''

jshint/jshint#2922

* jshint fixes

* karma -> Chrome

* add in chrome start stuff

* add empty test

* test/jshintrc

* use strict lulz

* test/jshintrc globals

* switch to non-pro key

* maybe this key will work??

* third times a charm?

* travis login --org

* skip cleanup

* bump angular-ui-router: ~0.3.2
koenweyn added a commit to acsl/select2 that referenced this issue May 16, 2018
davehorton pushed a commit to davehorton/node-esl that referenced this issue Sep 14, 2018
Fixes failing `grunt jshint` task:

    Running "jshint:lib" (jshint) task
    Verifying property jshint.lib exists in config...OK
    Files: lib/esl/Connection.js, lib/esl/Event.js, lib/esl/Parser.js, lib/esl/Server.js, lib/esl/esl.js, lib/index.js
    Options: force=false, reporterOutput=null, jshintrc=".jshintrc"
    Warning: Path must be a string. Received null Use --force to continue.

    Aborted due to warnings.

Likely fixed by
gruntjs/grunt-contrib-jshint@a0cd3db
which was needed due to a newer jshint version, see
jshint/jshint#2922

After the upgrade, have to disable a camelcase warning (W106) that
cannot be fixed since it is part of the interface. This also silences
some deprecation warnings in newer node versions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
9 participants