Closed BestLuke closed 5 years ago
I am receiving similar errors when I try deploying an app to heroku-18 stack:
cp: cannot overwrite directory '/app/tmp/cache/node_modules/phoenix' with non-directory
cp: cannot overwrite directory '/app/tmp/cache/node_modules/phoenix_html' with non-directory
My config also sets a recent node version:
# NodeJS version
node_version=10.15.1
# NPM version
npm_version=6.4.1
# Phoenix assets path
assets_path=assets
# Phoenix mix namespace
phoenix_ex=phx
@BestLuke were you able to find a work around?
Update
Adding this to the config file allowed a successful deploy:
# Clean out cache contents from previous deploys
clean_cache=true
After that, I set the value back to false
and successfully deployed again.
There must be something about the previous cache that was colliding with the previous node version used. In my case, I was using the default of the buildback: v6.9.2
Hope that helps...
@BestLuke it looks like this issue was caused by phoenix
and phoenix_html
inside node_modules no longer being directories. cp
can't overwrite directories with files. Changing the node version might have caused this or maybe updating the deps.
The only fix is to use clean_cache
as @yellow5 pointed out.
On gigalixir, we get customers asking about this issue almost every single day. I assume it is also happening frequently on Heroku. In fact, it's probably the single biggest issue we get regarding this buildpack. I wonder if there is a way to detect this scenario and fix it automatically. @gjaldon would you be willing to accept a pull request that fixes detects and auto-fixes this issue?
@jesseshieh I'd be happy to accept a PR to auto-detect and fix the issue.
Sorry if I am misjudging the issue but I will try and provide as much information as I can. -I have attempted to increase my node version through the buildpack to 10.10.0/8.11.2 as I have some nested javascript files that need to be running a higher version.(Being done through buildpacks config)
-When I push to Heroku and it does it's CI test's I get this error while in test setup
(which error's out the CI test) -This issue appears to be coming from within the install_and_cache_deps function of the lib/build.sh file
-The code will make it through the first cp command of the app without complication but when it reaches time to do the second cp command this issue occurs.
Am I missing something obvious or is this an issue with the buildpack and current versions of node?
If you need any more information please let me know and thank you in advance for any help you can provide