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

Rollup not recognized as a command when running grunt #176

Closed
nheminger opened this issue Apr 18, 2017 · 10 comments
Closed

Rollup not recognized as a command when running grunt #176

nheminger opened this issue Apr 18, 2017 · 10 comments
Labels

Comments

@nheminger
Copy link
Contributor

Running a grunt --force on Windows results in

Running "shell:command" (shell) task
'rollup' is not recognized as an internal or external command,
operable program or batch file.
Warning: Command failed: rollup -c
'rollup' is not recognized as an internal or external command,
operable program or batch file.
 Used --force, continuing.

Could it be a dependency issue?

@nheminger
Copy link
Contributor Author

Running npm install -g rollup fixes the problem. Possible to fix the dependencies or add documentation to the readme instructions so those running grunt will have it work?

@jgravois
Copy link
Contributor

the dependency is already listed in the package.json.
are you sure you ran a fresh npm install since pulling down the latest?

@nheminger
Copy link
Contributor Author

Yes, deleted the node_modules directory and ran a fresh npm install. Running npm 4.5.0 if that matters.

@jgravois
Copy link
Contributor

interesting.

do you see any errors during install?
is a directory called rollup not created?

@nheminger
Copy link
Contributor Author

Will try a fresh checkout and will verify if a directory rollup gets created. Didn't see any errors.

Does the -g install flag make it available via the shell command whereas the dependency prevents that?

@ecaldwell
Copy link
Contributor

This was also a complicating factor in #174. It seems that shell command only works with a globally installed rollup. I don't think there's any way to have npm install add it globally from package.json. Is there an alternative way of writing the shell command to reference the local path to rollup?

@nheminger
Copy link
Contributor Author

@ecaldwell Sounds like that is the issue.

Excellent, maybe there is a way the shell command can be reworked - perhaps direct grunt task invocation of rollup such as this I found: grunt-rollup?

If not, maybe a FAQ or addition to the README so people know to do the global install.

@ecaldwell
Copy link
Contributor

I think the FAQ/README should be updated first, then we can explore alternatives. I actually had tried using grunt-rollup originally, but couldn't get it to work. Maybe a newer version of it works.

nheminger added a commit to nheminger/ago-assistant that referenced this issue Apr 18, 2017
Puts in an extra step in the README to address the dependency that
rollup js be installed globally for now, so that it can be invoked via
the shell/command.
@ecaldwell
Copy link
Contributor

I think the solution is to specify the path to node_modules in the shell command. You can see this in my Gruntfile on #178.

Now the command looks like this rollup: "<%= node_modules %>rollup -c" where node_modules is defined earlier in the config as .\\node_modules\\.bin\\.

I tried a variety of combinations to get this to execute properly and this was the only way that worked. Unfortunately, the escaped backslashes are necessary—using forward slashes caused errors. It would be good for someone on a Unix machine to verify if this works.

@ecaldwell
Copy link
Contributor

Resolved in #201.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants