-
-
Notifications
You must be signed in to change notification settings - Fork 734
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
Windows - Error: /scripts/main.js Not Found #485
Comments
Could be that in index.html we have: <!-- build:js scripts/amd-app.js -->
<script data-main="scripts/main" src="scripts/vendor/require.js"></script>
<!-- endbuild --> And require.js doesn't find scripts/main because now the main.js was renamed to (in my case) 20beb7ef.main.js ? But why this thing occurs just on WINDOWS? |
I found a fast solution renaming some "dist/" files: rename "dist/20beb7ef.main.js" -> "dist/main.js" |
@murilobr when you run |
@latentflip No. On windows its not happening. |
The file scripts/d1ec6433.amd-app.js is generated, but nothing changes into dist/index.html |
This is maybe not just a windows issue, but also not certain this is the same issue you are seeing or a new issue. I tracked it down to a problem in this section of the auto-generated Gruntfile.js: // rjs configuration. You don't necessarily need to specify the typical
// `path` configuration, the rjs task will parse these values from your
// main module, using http://requirejs.org/docs/optimization.html#mainConfigFile
//
// name / out / mainConfig file should be used. You can let it blank if
// you're using usemin-handler to parse rjs config from markup (default
// setup)
rjs: {
// no minification, is done by the min task
optimize: 'none',
baseUrl: './scripts',
wrap: true,
name: 'main'
}, By default, my project was built using app/scripts/app.js instead of app/scripts/main.js. Changing either the file name or the name config option in the grunt file fixed it for me. Here's what my CLI looked like when build failed from brand new project build: Grants-MacBook-Air:Test grant$ yeoman build
Running "build" task
Running usemin target
- intro clean coffee compass mkdirs usemin-handler rjs concat css min img rev usemin manifest copy time
Running "intro" task
Running "clean" task
Running "coffee:compile" (coffee) task
Unable to compile; no valid source files were found.
Running "compass:dist" (compass) task
directory temp/styles/
create temp/styles/main.css
Running "mkdirs:staging" (mkdirs) task
Copying into /Users/grant/Projects/Test/temp
Ignoring .gitignore, .ignore, .buildignore
...................
>> /Users/grant/Projects/Test/app -> /Users/grant/Projects/Test/temp
Running "usemin-handler:html" (usemin-handler) task
Going through index.html to update the config
looking for build script HTML comment blocks
Found a block:
<script data-main="scripts/main" src="scripts/vendor/require.js"></script>
Updating config with the following assets:
- scripts/vendor/require.js
- scripts/amd-app.js
Configuration is now:
css:
{ 'styles/main.css': [ 'styles/**/*.css' ] }
concat:
{ dist: '',
'scripts/amd-app.js':
[ 'scripts/vendor/require.js',
'scripts/amd-app.js' ] }
min:
{ dist: '',
'scripts/amd-app.js': 'scripts/amd-app.js' }
rjs:
{ optimize: 'none',
baseUrl: './scripts',
wrap: true,
name: 'main',
out: 'scripts/amd-app.js' }
Running "rjs" task
Options:
{ optimize: 'none',
baseUrl: './scripts',
wrap: true,
name: 'main',
out: 'scripts/amd-app.js',
mainConfigFile: 'scripts/main.js' }
<WARN> Unable to read "scripts/main.js" file (Error code: ENOENT). Use --force to continue. </WARN>
Aborted due to warnings. |
+1 changing my Gruntfile.js to reference 'app' at line 172 seemed to get me further. Although, after getting past this, I have a new issue (Windows 7, Yeoman installed via Chocolatey), when I run Running "img:dist" (img) task
Running optipng... images/glyphicons-halflings-white.png, images/glyphicons-halflings.png
CreateProcessW: The system cannot find the path specified.
<WARN> optipng exited unexpectedly with exit code 127. Use --force to continue. </WARN>
Aborted due to warnings. |
Anyone knows why this error occurs, when type yeoman build?
The text was updated successfully, but these errors were encountered: