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

Grunt cannot find task sass:foundation_scss in v0.9.13 #114

Closed
abhidvnt opened this issue Dec 19, 2017 · 11 comments
Closed

Grunt cannot find task sass:foundation_scss in v0.9.13 #114

abhidvnt opened this issue Dec 19, 2017 · 11 comments

Comments

@abhidvnt
Copy link

I'm trying to generate documentation for a Swagger JSON generated using swagger-php, and am using the following command (it's a local npm install since I have to include it in version control, but the same thing happens when I install spectacle globally):

node node_modules/spectacle-docs/bin/spectacle.js -d "./docs/swagger.json" -t "./docs/html"

Schema:

{
    "swagger": "2.0",
    "info": {
        "title": "Control Panel API",
        "version": "1.0"
    },
    "schemes": [
        "https"
    ],
    "paths": {
        "/container/{id}": {
            "get": {
                "summary": "Returns information about a container using the provided identification",
                "operationId": "findContainerById",
                "produces": [
                    "application/json"
                ],
                "parameters": [
                    {
                        "parameter": "id",
                        "name": "id",
                        "in": "path",
                        "description": "The ID of the container",
                        "required": true,
                        "type": "integer"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A successful response returns the information about the container",
                        "schema": {
                            "properties": {
                                "error": {
                                    "description": "Returns information about a specific container using provided #ID",
                                    "type": "boolean",
                                    "default": "false"
                                },
                                "payload": {
                                    "description": "Returns information about a specific container using provided #ID",
                                    "properties": {
                                        "id": {
                                            "description": "Returns information about a specific container using provided #ID",
                                            "type": "integer"
                                        },
                                        "instances": {
                                            "description": "An object of the instances in this container, with instance ID as the key",
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    "bearer"
                ]
            }
        }
    },
    "definitions": {},
    "securityDefinitions": {
        "bearer": {
            "type": "apiKey",
            "description": "The API token is provided to the client during authentication",
            "in": "header"
        }
    }
}

It gives me the following output:

spectacle docs/swagger.json -t docs/html
Loading "sass.js" tasks...ERROR
>> Error: ENOENT: no such file or directory, scandir '/media/sf_goyal.115/webappapi/node_modules/node-sass/vendor'
Task error: Error: Task "sass:foundation_scss" not found.
    at Task.run (/home/echofoxxx/.nvm/versions/node/v8.9.2/lib/node_modules/spectacle-docs/node_modules/grunt/lib/util/task.js:179:28)
    at Object.thisTask.fn (/home/echofoxxx/.nvm/versions/node/v8.9.2/lib/node_modules/spectacle-docs/node_modules/grunt/lib/grunt/task.js:82:16)
    at Object.<anonymous> (/home/echofoxxx/.nvm/versions/node/v8.9.2/lib/node_modules/spectacle-docs/node_modules/grunt/lib/util/task.js:301:30)
    at Task.runTaskFn (/home/echofoxxx/.nvm/versions/node/v8.9.2/lib/node_modules/spectacle-docs/node_modules/grunt/lib/util/task.js:251:24)
    at Task.<anonymous> (/home/echofoxxx/.nvm/versions/node/v8.9.2/lib/node_modules/spectacle-docs/node_modules/grunt/lib/util/task.js:300:12)
    at Task.start (/home/echofoxxx/.nvm/versions/node/v8.9.2/lib/node_modules/spectacle-docs/node_modules/grunt/lib/util/task.js:309:5)
    at module.exports (/home/echofoxxx/.nvm/versions/node/v8.9.2/lib/node_modules/spectacle-docs/index.js:169:16)
    at Object.<anonymous> (/home/echofoxxx/.nvm/versions/node/v8.9.2/lib/node_modules/spectacle-docs/bin/spectacle.js:35:1)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Function.Module.runMain (module.js:676:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3
Task error: Error: Task "sass:scss" not found.
    at Task.run (/home/echofoxxx/.nvm/versions/node/v8.9.2/lib/node_modules/spectacle-docs/node_modules/grunt/lib/util/task.js:179:28)
    at Object.thisTask.fn (/home/echofoxxx/.nvm/versions/node/v8.9.2/lib/node_modules/spectacle-docs/node_modules/grunt/lib/grunt/task.js:82:16)
    at Object.<anonymous> (/home/echofoxxx/.nvm/versions/node/v8.9.2/lib/node_modules/spectacle-docs/node_modules/grunt/lib/util/task.js:301:30)
    at Task.runTaskFn (/home/echofoxxx/.nvm/versions/node/v8.9.2/lib/node_modules/spectacle-docs/node_modules/grunt/lib/util/task.js:251:24)
    at Task.<anonymous> (/home/echofoxxx/.nvm/versions/node/v8.9.2/lib/node_modules/spectacle-docs/node_modules/grunt/lib/util/task.js:300:12)
    at Task.<anonymous> (/home/echofoxxx/.nvm/versions/node/v8.9.2/lib/node_modules/spectacle-docs/node_modules/grunt/lib/util/task.js:230:9)
    at Task.runTaskFn (/home/echofoxxx/.nvm/versions/node/v8.9.2/lib/node_modules/spectacle-docs/node_modules/grunt/lib/util/task.js:257:7)
    at Task.<anonymous> (/home/echofoxxx/.nvm/versions/node/v8.9.2/lib/node_modules/spectacle-docs/node_modules/grunt/lib/util/task.js:300:12)
    at Task.start (/home/echofoxxx/.nvm/versions/node/v8.9.2/lib/node_modules/spectacle-docs/node_modules/grunt/lib/util/task.js:309:5)
    at module.exports (/home/echofoxxx/.nvm/versions/node/v8.9.2/lib/node_modules/spectacle-docs/index.js:169:16)
    at Object.<anonymous> (/home/echofoxxx/.nvm/versions/node/v8.9.2/lib/node_modules/spectacle-docs/bin/spectacle.js:35:1)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)

Running "concat:js" (concat) task
File docs/html/javascripts/spectacle.js created.

Running "uglify:js" (uglify) task
>> 1 file created.

Running "clean:html" (clean) task
>> 1 path cleaned.

Running "compile-handlebars:compile" (compile-handlebars) task
Unhandled rejection Error: Task "sass:foundation_scss" not found.
    at Task.run (/home/echofoxxx/.nvm/versions/node/v8.9.2/lib/node_modules/spectacle-docs/node_modules/grunt/lib/util/task.js:179:28)
    at Object.thisTask.fn (/home/echofoxxx/.nvm/versions/node/v8.9.2/lib/node_modules/spectacle-docs/node_modules/grunt/lib/grunt/task.js:82:16)
    at Object.<anonymous> (/home/echofoxxx/.nvm/versions/node/v8.9.2/lib/node_modules/spectacle-docs/node_modules/grunt/lib/util/task.js:301:30)
    at Task.runTaskFn (/home/echofoxxx/.nvm/versions/node/v8.9.2/lib/node_modules/spectacle-docs/node_modules/grunt/lib/util/task.js:251:24)
    at Task.<anonymous> (/home/echofoxxx/.nvm/versions/node/v8.9.2/lib/node_modules/spectacle-docs/node_modules/grunt/lib/util/task.js:300:12)
    at Task.start (/home/echofoxxx/.nvm/versions/node/v8.9.2/lib/node_modules/spectacle-docs/node_modules/grunt/lib/util/task.js:309:5)
    at module.exports (/home/echofoxxx/.nvm/versions/node/v8.9.2/lib/node_modules/spectacle-docs/index.js:169:16)
    at Object.<anonymous> (/home/echofoxxx/.nvm/versions/node/v8.9.2/lib/node_modules/spectacle-docs/bin/spectacle.js:35:1)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Function.Module.runMain (module.js:676:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3


Running "predentation" task

Running "prettify:index" (prettify) task
>> File "docs/html/index.html" prettified.
All tasks complete

I'm guessing there's something wrong with the versioning of grunt-sass? Or is it something with my installation?

@yyamano
Copy link
Contributor

yyamano commented Dec 20, 2017

@echofoxxx It looks the same problem as #105 . Could you try to remove node_modules and rerun npm install?

@gcoombe
Copy link

gcoombe commented Feb 19, 2018

I've encountered this same error. I removed my node_modules re-installed and still get the task not found errors.

@michaelherger
Copy link

I'm experiencing the same issue when installing as suggested running npm install -g spectacle-docs. Works when run from a repository clone.

@dsdenes
Copy link

dsdenes commented Mar 13, 2018

I had this error when spectacle was installed both globally and locally.

In my case, specifying to run the local binary, solved the problem:

./node_modules/.bin/spectacle

@auscaster
Copy link
Member

Hey guys, sorry you're having issues!

I've just made a bunch of updates to spectacle, and have pushed the release up to stable 1.0.0. I also tested installing spectacle globally and locally and was able to build my project successfully in each case, so hopefully this bug can be closed.

@auscaster
Copy link
Member

The minimum node version now supported is 8, which is required by grunt-sass.

@kminehart
Copy link

I was just unsuccessful and got this same error.

kminehart-solus rune/swagger ‹swaggerize*› » spectacle --version                                                                                           130 ↵
1.0.2
kminehart-solus rune/swagger ‹swaggerize*› » node -v     
v8.10.0
kminehart-solus rune/swagger ‹swaggerize*› » npm -v                       
5.6.0
kminehart-solus rune/swagger ‹swaggerize*› » spectacle ./swagger/billing/rpc/billing.swagger.json       
Loading "sass.js" tasks...ERROR
>> Error: ENOENT: no such file or directory, scandir '/usr/lib64/node_modules/spectacle-docs/node_modules/node-sass/vendor'
Task error: Error: Task "sass:foundation_scss" not found.
    at Task.run (/usr/lib64/node_modules/spectacle-docs/node_modules/grunt/lib/util/task.js:179:28)
    at Object.thisTask.fn (/usr/lib64/node_modules/spectacle-docs/node_modules/grunt/lib/grunt/task.js:82:16)
    at Object.<anonymous> (/usr/lib64/node_modules/spectacle-docs/node_modules/grunt/lib/util/task.js:301:30)
    at Task.runTaskFn (/usr/lib64/node_modules/spectacle-docs/node_modules/grunt/lib/util/task.js:251:24)
    at Task.<anonymous> (/usr/lib64/node_modules/spectacle-docs/node_modules/grunt/lib/util/task.js:300:12)
    at Task.start (/usr/lib64/node_modules/spectacle-docs/node_modules/grunt/lib/util/task.js:309:5)
    at module.exports (/usr/lib64/node_modules/spectacle-docs/index.js:169:16)
    at Object.<anonymous> (/usr/lib64/node_modules/spectacle-docs/bin/spectacle.js:36:1)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3
Task error: Error: Task "sass:scss" not found.
    at Task.run (/usr/lib64/node_modules/spectacle-docs/node_modules/grunt/lib/util/task.js:179:28)
    at Object.thisTask.fn (/usr/lib64/node_modules/spectacle-docs/node_modules/grunt/lib/grunt/task.js:82:16)
    at Object.<anonymous> (/usr/lib64/node_modules/spectacle-docs/node_modules/grunt/lib/util/task.js:301:30)
    at Task.runTaskFn (/usr/lib64/node_modules/spectacle-docs/node_modules/grunt/lib/util/task.js:251:24)
    at Task.<anonymous> (/usr/lib64/node_modules/spectacle-docs/node_modules/grunt/lib/util/task.js:300:12)
    at Task.<anonymous> (/usr/lib64/node_modules/spectacle-docs/node_modules/grunt/lib/util/task.js:230:9)
    at Task.runTaskFn (/usr/lib64/node_modules/spectacle-docs/node_modules/grunt/lib/util/task.js:257:7)
    at Task.<anonymous> (/usr/lib64/node_modules/spectacle-docs/node_modules/grunt/lib/util/task.js:300:12)
    at Task.start (/usr/lib64/node_modules/spectacle-docs/node_modules/grunt/lib/util/task.js:309:5)
    at module.exports (/usr/lib64/node_modules/spectacle-docs/index.js:169:16)
    at Object.<anonymous> (/usr/lib64/node_modules/spectacle-docs/bin/spectacle.js:36:1)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)

Running "concat:js" (concat) task
File /home/kminehart/Work/src/git.example.io/rune/rune/swagger/public/javascripts/spectacle.js created.

Running "uglify:js" (uglify) task
>> 1 file created.

Running "clean:html" (clean) task
>> 1 path cleaned.

Running "compile-handlebars:compile" (compile-handlebars) task
Unhandled rejection Error: Task "sass:foundation_scss" not found.
    at Task.run (/usr/lib64/node_modules/spectacle-docs/node_modules/grunt/lib/util/task.js:179:28)
    at Object.thisTask.fn (/usr/lib64/node_modules/spectacle-docs/node_modules/grunt/lib/grunt/task.js:82:16)
    at Object.<anonymous> (/usr/lib64/node_modules/spectacle-docs/node_modules/grunt/lib/util/task.js:301:30)
    at Task.runTaskFn (/usr/lib64/node_modules/spectacle-docs/node_modules/grunt/lib/util/task.js:251:24)
    at Task.<anonymous> (/usr/lib64/node_modules/spectacle-docs/node_modules/grunt/lib/util/task.js:300:12)
    at Task.start (/usr/lib64/node_modules/spectacle-docs/node_modules/grunt/lib/util/task.js:309:5)
    at module.exports (/usr/lib64/node_modules/spectacle-docs/index.js:169:16)
    at Object.<anonymous> (/usr/lib64/node_modules/spectacle-docs/bin/spectacle.js:36:1)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3


Running "predentation" task

Running "prettify:index" (prettify) task
>> File "/home/kminehart/Work/src/git.example.io/rune/rune/swagger/public/index.html" prettified.
All tasks complete

@auscaster
Copy link
Member

Thanks for the update, let's squash this once and for all!

The actual cause of the error is because of a missing folder, which causes the task to show as not found:

>> Error: ENOENT: no such file or directory, scandir '/usr/lib64/node_modules/spectacle-docs/node_modules/node-sass/vendor'

Looks like its directly related to this issue node-sass: sass/node-sass#1579

Suggested fixes for anyone hitting this snag:

  1. Make sure your node-sass version is greater than 3.7.0.
  2. Delete node_modules and npm install again.
  3. You can also try to rebuild node-sass like so:
npm update
npm install
nodejs node_modules/node-sass/scripts/install.js
npm rebuild node-sass 

@dapepe
Copy link

dapepe commented Apr 9, 2018

Worked for me!

@rlauriston
Copy link

rlauriston commented Apr 10, 2018

I'm not sure if this is the same problem. spectacle -d swagger.yaml fails with:

Loading "sass.js" tasks...ERROR
>> Error: ENOENT: no such file or directory, scandir '/usr/local/lib/node_modules/spectacle-docs/node_modules/node-sass/vendor'
Task error: Error: Task "sass:foundation_scss" not found.

There is in fact no file or directory named vendor in /usr/local/lib/node_modules/spectacle-docs/node_modules/node-sass.

I tried rebuilding node-sass but get "command not found" for nodejs, though /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Aliases/nodejs exists.

node-sass is 4.8.1. OS X 10.12.6.

@auscaster
Copy link
Member

This is fixed after updating grunt-saas and node-sass to support grunt 1.0.x

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

No branches or pull requests

9 participants