Angular-cli: ng init does not create assets folder if it's missing

Created on 21 Oct 2016  路  4Comments  路  Source: angular/angular-cli

OS?

Windows 10

Versions.

angular-cli: 1.0.0-beta.18
node: 6.6.0
os: win32 x64

Repro steps.

create an empty ng-cli project inplace

  • npm init
  • npm install --save-dev angular-cli
  • node_modules\.bin\ng init

The log given by the failure.

ENOENT: no such file or directory, stat 'c:srcng2srcassets'
Error: ENOENT: no such file or directory, stat 'c:srcng2srcassets'
at Error (native)
at Object.fs.statSync (fs.js:987:18)
at c:srcng2node_modulesangular-clipluginsglob-copy-webpack-plugin.js:16:64
at Array.map (native)
at GlobCopyWebpackPlugin.apply (c:srcng2node_modulesangular-clipluginsglob-copy-webpack-plugin.js:16:29)
at Compiler.apply (c:srcng2node_modulestapablelibTapable.js:233:16)
at WebpackOptionsApply.process (c:srcng2node_moduleswebpacklibWebpackOptionsApply.js:59:18)
at webpack (c:srcng2node_moduleswebpacklibwebpack.js:28:48)
at Class.run (c:srcng2node_modulesangular-clitasksbuild-webpack.js:20:31)
at Class.run (c:srcng2node_modulesangular-clicommandsbuild.js:50:26)
at Class. (c:srcng2node_modulesangular-clilibmodelscommand.js:152:17)
at tryCatch (c:srcng2node_modulesrsvpdistlibrsvp-internal.js:215:12)
at invokeCallback (c:srcng2node_modulesrsvpdistlibrsvp-internal.js:230:13)
at c:srcng2node_modulesrsvpdistlibrsvpthen.js:29:16
at flush (c:srcng2node_modulesrsvpdistlibrsvpasap.js:85:5)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)

Mention any other details that might be useful.

with global installation and ng new app works as expected

Most helpful comment

creating the assets folder manually fixed it for me... (not ideal though)

All 4 comments

creating the assets folder manually fixed it for me... (not ideal though)

That was a limitation of having the entry as a string actually... Now it's an array, you can leave it empty if you want. Regardless, the folder or files won't be created for you if they don't exist, that bit is intentional.

Turns out, in my case I have accidentally moved assets directory from angular-cli/src to angular-cli/src/environments by drag&drop in Atom. So make sure you have this directory created in angular-cli/src ;)

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings