npm > 2.7.5:"prefer global" warning causes failure "Command executed with exception"

saper's Avatar

saper

25 Jun, 2015 10:25 AM

We are getting build failures caused by "prefer global" flag in the jshint package:

npm : npm WARN prefer global jshint@2.8.0 should be installed with -g  
At line:1 char:1  
+ npm install --msvs_version=2013
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (npm WARN prefer...stalled with -g:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

kolor@1.1.6 node_modules\kolor  
jshint@2.8.0 node_modules\jshint  
Γö£ΓöÇΓöÇ strip-json-comments@1.0.2  
Γö£ΓöÇΓöÇ exit@0.1.2  
Γö£ΓöÇΓöÇ console-browserify@1.1.0 (date-now@0.1.4)  
Γö£ΓöÇΓöÇ shelljs@0.3.0  
Γö£ΓöÇΓöÇ minimatch@2.0.8 (brace-expansion@1.1.0)  
Γö£ΓöÇΓöÇ cli@0.6.6 (glob@3.2.11)  
Γö£ΓöÇΓöÇ htmlparser2@3.8.3 (domelementtype@1.3.0, entities@1.0.0, domhandler@2.3.0, readable-stream@1.1.13, domutils@1.5.1)  
ΓööΓöÇΓöÇ lodash@3.7.0  
Command executed with exception: npm WARN prefer global jshint@2.8.0 should be installed with -g

We have filed this bug also with npm:

https://github.com/npm/npm/issues/8517

So npm 2.7.4 works fine, npm > 2.7.5 fails.

Here are examples of the test project builds:

npm 2.10.1 with node 0.12.4:

https://ci.appveyor.com/project/saper/minijshint/build/job/r4tvf3ew...

npm 2.8.3 with iojs 1.8.1:

https://ci.appveyor.com/project/saper/minijshint/build/job/pgaxv2dq...

But npm 1.4.28 with node 0.10 works:

https://ci.appveyor.com/project/saper/minijshint/build/job/irrf573s...

It might be an npm problem, but we are unable to reproduce this locally - our project https://github.com/sass/node-sass builds fine also with newer npms locally, so there may be something special in the AppVeyor environment that causes this failure.

Mini test project can be checked out at:

https://github.com/saper/minijshint

  1. Support Staff 1 Posted by Feodor Fitsner on 25 Jun, 2015 10:43 PM

    Feodor Fitsner's Avatar

    Do not run npm install command as PowerShell. Remove ps: in this line: https://github.com/saper/minijshint/commit/35823eea71f25b2023a36b10...

  2. 2 Posted by saper on 07 Jul, 2015 01:35 AM

    saper's Avatar

    I have submitted https://github.com/npm/npm/pull/8841 to npm, this should fix that PowerShell issue.

    Any feedback welcome!

  3. Support Staff 3 Posted by Feodor Fitsner on 07 Jul, 2015 02:03 AM

    Feodor Fitsner's Avatar

    Thank you!

    - Feodor

  4. 4 Posted by saper on 28 Aug, 2015 10:02 AM

    saper's Avatar

    The fix for this is now part of npm 2.14.2. npm still prints some things to stderr sometimes (like warning about failed optional dependency), but this particular issue has been solved.

  5. saper closed this discussion on 28 Aug, 2015 10:02 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

20 Mar, 2019 01:15 PM
20 Mar, 2019 11:09 AM
20 Mar, 2019 10:37 AM
20 Mar, 2019 09:01 AM
20 Mar, 2019 08:51 AM

 

20 Mar, 2019 02:33 AM
19 Mar, 2019 06:21 PM
19 Mar, 2019 06:03 PM
19 Mar, 2019 05:22 PM
19 Mar, 2019 05:08 PM
19 Mar, 2019 05:00 PM