Bug 1252237

Summary: grunt does not find grunt.js
Product: [Fedora] Fedora Reporter: Orion Poplawski <orion>
Component: nodejs-grunt-cliAssignee: NodeJS Packaging SIG <nodejs-sig>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 25CC: mrunge, piotr1212, rmeggins, tchollingsworth, zsvetlik
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-12 10:04:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Orion Poplawski 2015-08-11 03:47:46 UTC
Description of problem:

$ grunt
grunt-cli: The grunt command line interface. (v0.1.13)

Fatal error: Unable to find local grunt.

If you're seeing this message, either a Gruntfile wasn't found or grunt
hasn't been installed locally to your project. For more information about
installing and configuring grunt, please see the Getting Started guide:

http://gruntjs.com/getting-started


It seems it's not finding /usr/lib/node_modules/grunt/lib/grunt.js

$ strace grunt 2>&1 | grep -F grunt.js
stat("/home/orion/redhat/js-jquery-backstretch-2.0.4/jquery-backstretch-2.0.4/node_modules/grunt.js", 0x7ffdf3496298) = -1 ENOENT (No such file or directory)
stat("/home/orion/redhat/js-jquery-backstretch-2.0.4/node_modules/grunt.js", 0x7ffdf3496298) = -1 ENOENT (No such file or directory)
stat("/home/orion/redhat/node_modules/grunt.js", 0x7ffdf3496298) = -1 ENOENT (No such file or directory)
stat("/home/orion/node_modules/grunt.js", 0x7ffdf3496298) = -1 ENOENT (No such file or directory)
stat("/home/node_modules/grunt.js", 0x7ffdf3496298) = -1 ENOENT (No such file or directory)
stat("/node_modules/grunt.js", 0x7ffdf3496298) = -1 ENOENT (No such file or directory)
stat("lib/grunt.js", 0x7ffdf3495b28)    = -1 ENOENT (No such file or directory)
stat("/home/orion/redhat/js-jquery-backstretch-2.0.4/lib/grunt.js", 0x7ffdf3495b28) = -1 ENOENT (No such file or directory)
stat("/home/orion/redhat/lib/grunt.js", 0x7ffdf3495b28) = -1 ENOENT (No such file or directory)
stat("/home/orion/lib/grunt.js", 0x7ffdf3495b28) = -1 ENOENT (No such file or directory)
stat("/home/lib/grunt.js", 0x7ffdf3495b28) = -1 ENOENT (No such file or directory)
stat("/lib/grunt.js", 0x7ffdf3495b28)   = -1 ENOENT (No such file or directory)

Version-Release number of selected component (if applicable):
nodejs-grunt-cli-0.1.13-2.fc21.noarch

Comment 1 Fedora End Of Life 2015-11-04 10:54:09 UTC
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '21'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 21 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 2 Matthias Runge 2016-04-26 21:19:59 UTC
still valid on f23

Comment 3 Matthias Runge 2016-04-26 21:20:37 UTC
Is there anything missing or anything we can do to support you in fixing the issue?

Comment 4 Matthias Runge 2016-04-27 21:01:37 UTC
I briefly updated to 1.2.0, but the problem still exists. I wonder if it's a more generic issue.

Comment 5 Matthias Runge 2016-08-26 10:00:00 UTC
grunt seems to work if you're in the dir with your Gruntfils.js and do:
ln -s /usr/lib/node_modules

Comment 6 Piotr Popieluch 2016-08-26 18:27:14 UTC
yes, grunt really wants to be installed in the project directory and run from there. In nodejs packages which require grunt the node_modules are symlinked.

Not sure if there is anything we can/need/should to do here.

Comment 7 Orion Poplawski 2016-09-07 17:47:55 UTC
Perhaps worth having a %grunt rpm macro the would do what is needed to build a project?

Comment 8 Piotr Popieluch 2016-09-08 20:18:26 UTC
Not sure what you mean with a project. 

If you are building a nodejs rpm package use `%nodejs_symlink_deps --check` as described in the guidelines [1] or see [2] as example.

If you working on some nodejs project you probably use `npm install` anyway which installs all deps in the working dir.


[1] https://fedoraproject.org/wiki/Packaging:Node.js?rd=Node.js/Packagers#Build_testing_in_.25check
[2] http://pkgs.fedoraproject.org/cgit/rpms/nodejs-grunt-banner.git/tree/nodejs-grunt-banner.spec#n63

Comment 9 Piotr Popieluch 2016-09-08 20:21:50 UTC
This might be a better (actually working) example:
http://pkgs.fedoraproject.org/cgit/rpms/nodejs-grunt-legacy-log-utils.git/tree/nodejs-grunt-legacy-log-utils.spec#n51

Comment 10 Fedora End Of Life 2016-11-24 12:17:18 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 11 Fedora End Of Life 2017-11-16 19:03:53 UTC
This message is a reminder that Fedora 25 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 25. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '25'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 25 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 12 Fedora End Of Life 2017-12-12 10:04:56 UTC
Fedora 25 changed to end-of-life (EOL) status on 2017-12-12. Fedora 25 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.