4
votes

I am getting following error while trying to build project using 'Angular-cli'


D:\workspace\migration-project>ng build
ENOENT: no such file or directory, stat 'D:\workspace\migration-project\src\assets'
Error: ENOENT: no such file or directory, stat 'D:\workspace\migration-project\src\assets'
    at Error (native)
    at Object.fs.statSync (fs.js:844:18)
    at D:\workspace\migration-project\node_modules\angular-cli\plugins\glob-copy-webpack-plugin.js:16:64
    at Array.map (native)
    at GlobCopyWebpackPlugin.apply (D:\workspace\migration-project\node_modules\angular-cli\plugins\glob-copy-webpack-plugin.js:16:29)
    at Compiler.apply (D:\workspace\migration-project\node_modules\tapable\lib\Tapable.js:233:16)
    at WebpackOptionsApply.process (D:\workspace\migration-project\node_modules\webpack\lib\WebpackOptionsApply.js:59:18)
    at webpack (D:\workspace\migration-project\node_modules\webpack\lib\webpack.js:28:48)
    at Class.exports.default.Task.extend.run (D:\workspace\migration-project\node_modules\angular-cli\tasks\build-webpack.js:20:31)
    at Class.Command.extend.run (D:\workspace\migration-project\node_modules\angular-cli\commands\build.js:50:26)
    at Class. (D:\workspace\migration-project\node_modules\angular-cli\lib\models\command.js:152:17)
    at tryCatch (D:\workspace\migration-project\node_modules\rsvp\dist\lib\rsvp\-internal.js:215:12)
    at invokeCallback (D:\workspace\migration-project\node_modules\rsvp\dist\lib\rsvp\-internal.js:230:13)
    at D:\workspace\migration-project\node_modules\rsvp\dist\lib\rsvp\then.js:29:16
    at flush (D:\workspace\migration-project\node_modules\rsvp\dist\lib\rsvp\asap.js:85:5)
    at nextTickCallbackWith0Args (node.js:420:9)
    at process._tickCallback (node.js:349:13)
 

And I actually don't have any assets directory or file in src. Not sure why it is asking for it.

OS: Windows 10
webpack: 2.1.0-beta.25
angular-cli: 1.0.0-beta.19-3 (locally & globally)
@angular & @angular/material : latest version
There is no install in npm install

Anyone faced similar issue? Any leads will be greatly helpful.

Update: Problem is with angular-cli. Issue was resolved after rolling back angular-cli to 1.0.0-beta.17

1

1 Answers

3
votes

I solved the problem by manually creating the src/assets folder after updating to angular-cli version 1.0.0-beta.20-4

When you create a new project using the latest angular-cli:

ng new migration-project

a folder is created:

src/assets

with a file called .gitkeep

I haven't looked into why this folder is required, but everything is working again.