coreybutler / node-windows

Windows support for Node.JS scripts (daemons, eventlog, UAC, etc).
Other
2.79k stars 358 forks source link

Local Npm module "grunt-cli" not found. Is it installed? #244

Closed cluber22 closed 4 years ago

cluber22 commented 4 years ago

I am trying to install grunt-cli locally but it is not working. I am running the below commands as admin.

C:\_Webs\adapt_authoring>npm install grunt-cli --save-dev
+ grunt-cli@1.3.2
updated 1 package in 6.31s

C:\_Webs\adapt_authoring>grunt
>> Local Npm module "grunt-cli" not found. Is it installed?

Running "build:dev" (build) task

Building application in dev mode

Running "migration-conf" task

Running "requireBundle:modules" (requireBundle) task

Running "requireBundle:plugins" (requireBundle) task

Running "generate-lang-json" task

Running "copy:main" (copy) task
Created 1 directory, copied 254 files

Running "less:dev" (less) task

Running "handlebars:compile" (handlebars) task
>> 1 file created.

Running "requirejs:dev" (requirejs) task

Done.

The reason I'm running here is because I'm trying to run a node package via https://github.com/coreybutler/node-windows however it's erroring and the service won't start:

info [10 Dec 19 17:35:00 +00:00] Supporting the following authentication types:
info [10 Dec 19 17:35:00 +00:00] - local
error [10 Dec 19 17:35:00 +00:00] grunt-cli could not be found, please check it is installed
info [10 Dec 19 17:35:01 +00:00] Connection established: adapt-tenant-master
error [10 Dec 19 17:35:01 +00:00] Some of the prerequisites could not be found, see above for details.

Any help greatly appreciated.

coreybutler commented 4 years ago

That's not how Node CLI apps work. You have to install with the -g because it sets up a link in the global bin directory. If you want to use it locally, you have to reference it from the relevant node_modules directory... i.e. instead of running grunt, you have to run node .\node_modules\grunt\bin\grunt.js (or whatever the path is to the CLI file).

Closing as this is not a node-windows issue.