FountainJS / generator-fountain-angular1

Yeoman 'fountain' generator to start a webapp with Angular 1
http://fountainjs.io
MIT License
95 stars 34 forks source link

Get 404 error in index.css #70

Open ronaiza-cardoso opened 7 years ago

ronaiza-cardoso commented 7 years ago

Description

I installed yo and was using the cli I to creating the hello world project. When I run the npm run serve it runs on port 3000 but the index.css is not delivered. I havegulp installed globally on version CLI version 3.9.1 and Local version 4.0.0-alpha.2

Error Message & Stack Trace

when a change the index.scss to index.css I have this error

λ npm run serve

> @ serve C:\Users\ronai\Desktop\getting-start-Angular-1-5
> gulp serve

[11:12:30] Loading C:\Users\ronai\Desktop\getting-start-Angular-1-5\gulp_tasks\browsersync.js
[11:12:30] Loading C:\Users\ronai\Desktop\getting-start-Angular-1-5\gulp_tasks\build.js
[11:12:50] Loading C:\Users\ronai\Desktop\getting-start-Angular-1-5\gulp_tasks\inject.js
[11:12:50] Loading C:\Users\ronai\Desktop\getting-start-Angular-1-5\gulp_tasks\karma.js
[11:12:52] Loading C:\Users\ronai\Desktop\getting-start-Angular-1-5\gulp_tasks\misc.js
[11:12:52] Loading C:\Users\ronai\Desktop\getting-start-Angular-1-5\gulp_tasks\partials.js
[11:12:52] Loading C:\Users\ronai\Desktop\getting-start-Angular-1-5\gulp_tasks\scripts.js
[11:12:55] Loading C:\Users\ronai\Desktop\getting-start-Angular-1-5\gulp_tasks\styles.js
[11:12:55] Using gulpfile ~\Desktop\getting-start-Angular-1-5\gulpfile.js
[11:12:55] Starting 'serve'...
[11:12:55] Starting 'inject'...
[11:12:55] Starting 'styles'...
[11:12:55] Starting 'scripts'...
[11:12:56] 'styles' errored after 558 ms
[11:12:56] Error: File not found with singular glob: C:\Users\ronai\Desktop\getting-start-Angular-1-5\src\index.scss
    at Glob.<anonymous> (C:\Users\ronai\Desktop\getting-start-Angular-1-5\node_modules\glob-stream\index.js:41:11)
    at Glob.g (events.js:291:16)
    at emitOne (events.js:96:13)
    at Glob.emit (events.js:188:7)
    at Glob._finish (C:\Users\ronai\Desktop\getting-start-Angular-1-5\node_modules\glob-stream\node_modules\glob\glob.js:172:8)
    at done (C:\Users\ronai\Desktop\getting-start-Angular-1-5\node_modules\glob-stream\node_modules\glob\glob.js:159:12)
    at Glob._processSimple2 (C:\Users\ronai\Desktop\getting-start-Angular-1-5\node_modules\glob-stream\node_modules\glob\glob.js:652:12)
    at C:\Users\ronai\Desktop\getting-start-Angular-1-5\node_modules\glob-stream\node_modules\glob\glob.js:640:10
    at Glob._stat2 (C:\Users\ronai\Desktop\getting-start-Angular-1-5\node_modules\glob-stream\node_modules\glob\glob.js:736:12)
    at lstatcb_ (C:\Users\ronai\Desktop\getting-start-Angular-1-5\node_modules\glob-stream\node_modules\glob\glob.js:728:12)
    at RES (C:\Users\ronai\Desktop\getting-start-Angular-1-5\node_modules\inflight\inflight.js:31:16)
    at f (C:\Users\ronai\Desktop\getting-start-Angular-1-5\node_modules\once\once.js:25:25)
    at FSReqWrap.oncomplete (fs.js:123:15)
[11:12:56] 'inject' errored after 568 ms
[11:12:56] 'serve' errored after 574 ms
[11:12:56] The following tasks did not complete: scripts
[11:12:56] Did you forget to signal async completion?

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "serve"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! @ serve: `gulp serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ serve script 'gulp serve'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     gulp serve
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\ronai\Desktop\getting-start-Angular-1-5\npm-debug.log

but when I leave it the default way I have no error on cmd but on page dont appear nothing and the console says tha the index.css are not delivered

Config

Copy the content from .yo-rc.json:

{
  "generator-fountain-angular1": {
    "version": "1.0.0-rc1",
    "props": {
      "resolved": "C:\\Users\\ronai\\AppData\\Roaming\\npm\\node_modules\\generator-fountain-angular1\\generators\\app\\index.js",
      "namespace": "fountain-angular1:app",
      "argv": {
        "remain": [],
        "cooked": [],
        "original": []
      },
      "framework": "angular1",
      "modules": "inject",
      "css": "scss",
      "js": "js",
      "ci": [],
      "sample": "hello",
      "router": "uirouter"
    }
  }
}

Environment

Tell us which operating system you are using, as well as which versions of Node.js, npm, and yo. Run the following to get it quickly:

Node.js v6.9.1

win32 10.0.14393

yo --version
1.8.5

npm --version
3.10.8
eduardoborges commented 7 years ago

Same problem here :/

eduardoborges commented 7 years ago

I found a temporary solution in:

https://github.com/FountainJS/generator-fountain-webapp/issues/150

Just do: $ npm shrinkwrap

and replace code in node_modules > glob-stream > node-modules > glob-parent > index.js

to 3.0.0 version. likes this:

'use strict';

var path = require('path');
var isglob = require('is-glob');

module.exports = function globParent(str) {
    str += 'a'; // preserves full path in case of trailing path separator
    do {str = path.dirname(str)} while (isglob(str));
    return str;
};
Rooni commented 7 years ago

You use $ npm shrinkwrap so you dont have to edit the files manually, but instead force it to use an older version of glob-parent. This way, even when you were to set it up somewhere else, it'll use the old version and you wouldn't face it again, because it would just download glob-parent without the changes you made.

After $ npm shrinkwrap it'll create a shrinkwrap.json file for you where you can configure it to use the old non-broken version.

paolocarrasco commented 7 years ago

Is there any news to fix this by using the same thing we generate at the beginning? If the npm-shrinkwrap.json is the solution, is it ok if I commit the file to the generator?

micaelmbagira commented 7 years ago

Hi @paolocarrasco @yesroh I cannot reproduce it. Could you download the latest version of our generator (rc2) and tell me if it happens again ?