2.0.0-rc0 Error copying "src/assets" to "www/assets/"


#1

Hi,

I’m getting the following error on a brand new app created with the ionic2-starter-sidemenu. As a workaround, I’ve been manually copying the ionicon files to the www/assets and that works but I want to find a permanent solution.

Any ideas?

[07:05:04]  Error copying "src/assets/" to "www/assets/": Error: EPERM: operation not permitted, open
C:\ionic\moneyleash\www\assets\fonts\ionicons.eot',Error: EPERM: operation not permitted, open
C:\ionic\moneyleash\www\assets\fonts\ionicons.svg',Error: EPERM: operation not permitted, open 
C:\ionic\moneyleash\www\assets\fonts\ionicons.ttf',Error: EPERM: operation not permitted, open 
C:\ionic\moneyleash\www\assets\fonts\ionicons.woff',Error: EPERM: operation not permitted, open 
C:\ionic\moneyleash\www\assets\fonts\ionicons.woff2

Here’s my info

Cordova CLI: 6.3.1
Ionic Framework Version: 2.0.0-rc.0
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
OS:
Node Version: v6.7.0

and I already ran the following command on my PC

npm install —save @ionic/app-scripts@latest


Ionic 2 - no icons
#2

Looks like there is an issue already logged


#3

I don’t think that’s your problem. You have filesystem permission issues that can probably be solved with chown/chmod.


#4

Agree.
You should change permissions of your folder project or run your project as administrator.


#5

Do you find a solution for that?

Ionic serve show icons right but when I build android app the icons doesn’t appear.

My system information:

Cordova CLI: 6.3.1
Ionic Framework Version: 2.0.0-rc.0
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
OS:
Node Version: v6.7.0

I start my project from sidemenu templete.


#6

UPDATE: I am running the project as administrator and I’m using Windows 10 so chown/chmod is not an option for me.

Any other ideas?


#7

+1 this issue. Same exact info except running node v6.3.1. Tried a lot of different things to no effect. Also after running serve it hangs at sass finished…

EDIT
Literally right after posting this ionic served as normal. Found that running ionic serve right after running ionic info worked for some reason. A proper fix is of course still needed but for now you could try this


#8

As it seems to be a permission problem, try delete www/assets and run ion build (to catch another error if exists) then ion serve


#9

This worked for me and got the app to build initially (ion build android) but ion serve and subsequent builds failed in the same way after


#10

Maybe this can help you figure out the problem

Win10 had (or has?) an issue with permission, here is an old and long post about it with a few workarounds


#11

Not sure if this fixed the issue (at least temporarily). But after doing this and restarting my machine ionic serve worked fine (apart from some Javascript heap out of memory errors…
Randomly after running ionic serve again it reverted to the same permissions problem though…


#12

After updating to RC0 and taking the latest of ionic conference app. I am also getting this error:
Error copying “src/assets/” to “www/assets/”. Interestingly, even if I delete build and assets folder from www, the error still shows. Already tried restarting the machine, installing node modules again and again.


#13

@ecureuill I tried the suggestions from the links you posted to no avail.

On Windows 10 - Issue persists

On Windows 7 Pro - No issues


#15

Happens to me randomly as well. I am on Windows 10. Sometimes fonts get copied, sometimes they don’t. No pattern as to when the problem occurs. Experiencing the issue with both ionic serve and ionic build android.


#16

@pickupman If you are using Windows 10, I was having the same situation. Please follow this:


#17

@codestellar I followed your steps from #66245 to no avail

From command window:

[10:40:01]  copy failed:  Error copying "src/assets/" to "www/assets/": Error: EPERM: operation not permitted, open 'C:\ionic\MoneyLeash2\www\assets\fonts\ionicons.svg',Error: EPERM: operation not permitted, open 'C:\ionic\MoneyLeash2\www\assets\fonts\ionicons.eot',Error: EPERM: operation not permitted, open 'C:\ionic\MoneyLeash2\www\assets\fonts\ionicons.woff',Error: EPERM: operation not permitted, open 'C:\ionic\MoneyLeash2\www\assets\fonts\ionicons.ttf',Error: EPERM: operation not permitted, open 'C:\ionic\MoneyLeash2\www\assets\fonts\ionicons.woff2'

[10:40:01]  Error: Error copying "src/assets/" to "www/assets/": Error: EPERM: operation not permitted, open 'C:\ionic\MoneyLeash2\www\assets\fonts\ionicons.svg',Error: EPERM: operation not permitted, open 'C:\ionic\MoneyLeash2\www\assets\fonts\ionicons.eot',Error: EPERM: operation not permitted, open 'C:\ionic\MoneyLeash2\www\assets\fonts\ionicons.woff',Error: EPERM: operation not permitted, open 'C:\ionic\MoneyLeash2\www\assets\fonts\ionicons.ttf',Error: EPERM: operation not permitted, open 'C:\ionic\MoneyLeash2\www\assets\fonts\ionicons.woff2'
    at C:\ionic\MoneyLeash2\node_modules\@ionic\app-scripts\dist\copy.js:41:28
    at doneOne (C:\ionic\MoneyLeash2\node_modules\fs-extra\lib\copy\ncp.js:237:23)
    at C:\ionic\MoneyLeash2\node_modules\fs-extra\lib\copy\ncp.js:122:11
    at C:\ionic\MoneyLeash2\node_modules\graceful-fs\polyfills.js:219:18
    at FSReqWrap.oncomplete (fs.js:123:15)

(node:7288) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 5): Error: Error copying "src/assets/" to "www/assets/": Error: EPERM: operation not permitted, open 'C:\ionic\MoneyLeash2\www\assets\fonts\ionicons.svg',Error: EPERM: operation not permitted, open 'C:\ionic\MoneyLeash2\www\assets\fonts\ionicons.eot',Error: EPERM: operation not permitted, open 'C:\ionic\MoneyLeash2\www\assets\fonts\ionicons.woff',Error: EPERM: operation not permitted, open 'C:\ionic\MoneyLeash2\www\assets\fonts\ionicons.ttf',Error: EPERM: operation not permitted, open 'C:\ionic\MoneyLeash2\www\assets\fonts\ionicons.woff2'

#18

This error is preventing the main.js and main.css files from getting created. Thus, the app doesn’t load.

How can I remove the “copy of fonts” part from the build? I can manually copy them in the meantime until a solution is found


#19

Can you please uninstall ionic, delete node_modules, npm clean cache -f again? or ping me on skype gaurav.madaan9


#20

@codestellar thanks for the offer to connect on skype but I think I found a pattern and a fix to my problem.

If I modify an existing beta.11 project to RC0 I get the same error “copying assets…”. However, if I copy my project to a NEW project , everything works. This is working for me now.

Thanks to everyone for all your tips and suggestions!


#21

That’s probably because your ionic cli is not updated in that case.