apache / cordova-ios

Apache Cordova iOS
https://cordova.apache.org/
Apache License 2.0
2.16k stars 987 forks source link

Cordova iOS 5.0.0 Cannot copy '../../c3.css' to a subdirectory of itself, '../../c3.css'. #575

Closed pontigol closed 1 year ago

pontigol commented 5 years ago

Bug Report

Problem

When installing Cordova iOS 5.0.0 I get Cannot copy '../../c3.css' to a subdirectory of itself, '../../c3.css'. . Subsequent builds will fail with the same error. C3 is a graphing library I use that I have located in www/static/. It's okay when using 4.5.5 but not 5.0.0.

Information

Version information

Cordova: 8.1.2 (cordova-lib@8.1.1) Cordova iOS: 5.0.0 Operating System: macOS Mojave 10.14.2

janpio commented 5 years ago

Is this reproducible in a new, plain Cordova app? A minimal reproduction repository would really help to debug and later fix this issue. More information on how to create one: https://github.com/apache/cordova-contribute/blob/master/create-reproduction.md

magancete commented 5 years ago

Same issue with .js file located in www/js folder, any solution?

janpio commented 5 years ago

Can you recreate a this problem in a project that we can try @magancete?

magancete commented 5 years ago

It happens when creating a completely empty new project. In old projects it does not happen

janpio commented 5 years ago

Can you please upload such a project to GitHub, so we can just clone it and run cordova platform add ios (I assume) to reproduce the error? Please also post the complete output you are getting when running this command, including the error message @pontigol already described.

magancete commented 5 years ago

This is my output when i add platform, it happens also in android platform

PS D:\Carlos\Cordova\Proyectos\toolkit> cordova platform add ios
Using cordova-fetch for cordova-ios@^5.0.0
Adding ios project...
Creating Cordova project for the iOS platform:
        Path: platforms\ios
        Package: com.magan.toolkit
        Name: FreeBitcoin Toolkit
iOS project created with cordova-ios@5.0.1
Cannot copy 'D:\Carlos\Cordova\Proyectos\toolkit\www\js\index.js' to a subdirectory of itself, 'D:\Carlos\Cordova\Proyectos\toolkit\platforms\ios'.
janpio commented 5 years ago

What node and npm versions are you using? Can you run the command with --verbose to possibly get more output?

magancete commented 5 years ago

Node version: v8.9.4 Npm verskion: 6.9.0

Extended output:

PS D:\Carlos\Cordova\Proyectos\toolkit> cordova platform add ios --verbose
No scripts found for hook "before_platform_add".
No version supplied. Retrieving version from config.xml...
Grabbing pinned version.
Using cordova-fetch for cordova-ios@^5.0.0
fetch: Installing cordova-ios@^5.0.0 to D:\Carlos\Cordova\Proyectos\toolkit
Running command: npm install cordova-ios@^5.0.0 --production --save
Command finished with error code 0: npm install,cordova-ios@^5.0.0,--production,--save
Removing "cordova-" prefix from cordova-ios
Adding ios project...
PlatformApi successfully found for platform ios
Creating Cordova project for the iOS platform:
        Path: platforms\ios
        Package: com.magan.toolkit
        Name: FreeBitcoin Toolkit
Copying iOS template project to D:\Carlos\Cordova\Proyectos\toolkit\platforms\ios
iOS project created with cordova-ios@5.0.1
Checking for any plugins added to the project that have not been installed in ios platform
No differences found between plugins added to project and installed in ios platform. Continuing...
PlatformApi successfully found for platform ios
Generating platform-specific config.xml from defaults for iOS at D:\Carlos\Cordova\Proyectos\toolkit\platforms\ios\FreeBitcoin Toolkit\config.xml
Merging project's config.xml into platform-specific iOS config.xml
Merging and updating files from [www, platforms\ios\platform_www] to platforms\ios\www
  mkdir platforms\ios\www\cordova-js-src
  copy  platforms\ios\platform_www\cordova-js-src\exec.js platforms\ios\www\cordova-js-src\exec.js (new file)
  copy  platforms\ios\platform_www\cordova-js-src\platform.js platforms\ios\www\cordova-js-src\platform.js (new file)
  mkdir platforms\ios\www\cordova-js-src\plugin
  mkdir platforms\ios\www\cordova-js-src\plugin\ios
  copy  platforms\ios\platform_www\cordova-js-src\plugin\ios\console.js platforms\ios\www\cordova-js-src\plugin\ios\console.js (new file)
  copy  platforms\ios\platform_www\cordova-js-src\plugin\ios\logger.js platforms\ios\www\cordova-js-src\plugin\ios\logger.js (new file)
  copy  platforms\ios\platform_www\cordova.js platforms\ios\www\cordova.js (updated file)
  copy  www\css\framework.css platforms\ios\www\css\framework.css (new file)
  delete platforms\ios\www\css\index.css (no source)
  copy  www\css\style.css platforms\ios\www\css\style.css (new file)
  copy  www\index.html platforms\ios\www\index.html (updated file)
  copy  www\js\index.js platforms\ios\www\js\index.js (updated file)
Cannot copy 'D:\Carlos\Cordova\Proyectos\toolkit\www\js\index.js' to a subdirectory of itself, 'D:\Carlos\Cordova\Proyectos\toolkit\platforms\ios'.
Error: Cannot copy 'D:\Carlos\Cordova\Proyectos\toolkit\www\js\index.js' to a subdirectory of itself, 'D:\Carlos\Cordova\Proyectos\toolkit\platforms\ios'.
    at checkParentPathsSync (D:\Carlos\Cordova\Proyectos\toolkit\node_modules\fs-extra\lib\util\stat.js:151:11)
    at checkParentPathsSync (D:\Carlos\Cordova\Proyectos\toolkit\node_modules\fs-extra\lib\util\stat.js:153:10)
    at checkParentPathsSync (D:\Carlos\Cordova\Proyectos\toolkit\node_modules\fs-extra\lib\util\stat.js:153:10)
    at Object.checkParentPathsSync (D:\Carlos\Cordova\Proyectos\toolkit\node_modules\fs-extra\lib\util\stat.js:153:10)
    at Object.copySync (D:\Carlos\Cordova\Proyectos\toolkit\node_modules\fs-extra\lib\copy-sync\copy-sync.js:27:8)
    at updatePathWithStats (D:\Carlos\Cordova\Proyectos\toolkit\node_modules\cordova-common\src\FileUpdater.js:103:24)
    at D:\Carlos\Cordova\Proyectos\toolkit\node_modules\cordova-common\src\FileUpdater.js:298:19
    at Array.forEach (<anonymous>)
    at Object.mergeAndUpdateDir (D:\Carlos\Cordova\Proyectos\toolkit\node_modules\cordova-common\src\FileUpdater.js:296:33)
    at updateWww (D:\Carlos\Cordova\Proyectos\toolkit\platforms\ios\cordova\lib\prepare.js:162:17)
janpio commented 5 years ago

Oh, that rings a bell: https://github.com/apache/cordova/issues/121

Please run npm list | grep common in your project and post the output.

This might be some instructions to work around or fix this: https://github.com/apache/cordova/issues/121#issuecomment-502143314

magancete commented 5 years ago

I wil try this solution

This is my output:

PS D:\Carlos\Cordova\Proyectos\toolkit> npm list
com.magan.toolkit@1.0.0 D:\Carlos\Cordova\Proyectos\toolkit
+-- cordova-android@8.0.0
| +-- android-versions@1.4.0
| | `-- semver@5.7.0
| +-- cordova-common@3.2.0
| | +-- ansi@0.3.1
| | +-- bplist-parser@0.1.1
| | | `-- big-integer@1.6.44
| | +-- cross-spawn@6.0.5
| | | +-- nice-try@1.0.5
| | | +-- path-key@2.0.1
| | | +-- semver@5.7.0 deduped
| | | +-- shebang-command@1.2.0
| | | | `-- shebang-regex@1.0.0
| | | `-- which@1.3.1 deduped
| | +-- elementtree@0.1.7 deduped
| | +-- endent@1.3.0
| | | +-- dedent@0.7.0
| | | +-- fast-json-parse@1.0.3
| | | `-- objectorarray@1.0.3
| | |   `-- tape@4.10.2
| | |     +-- deep-equal@1.0.1
| | |     +-- defined@1.0.0
| | |     +-- for-each@0.3.3
| | |     | `-- is-callable@1.1.4
| | |     +-- function-bind@1.1.1
| | |     +-- glob@7.1.4 deduped
| | |     +-- has@1.0.3
| | |     | `-- function-bind@1.1.1 deduped
| | |     +-- inherits@2.0.3 deduped
| | |     +-- minimist@1.2.0
| | |     +-- object-inspect@1.6.0
| | |     +-- resolve@1.10.1
| | |     | `-- path-parse@1.0.6
| | |     +-- resumer@0.0.0
| | |     | `-- through@2.3.8 deduped
| | |     +-- string.prototype.trim@1.1.2
| | |     | +-- define-properties@1.1.3
| | |     | | `-- object-keys@1.1.1
| | |     | +-- es-abstract@1.13.0
| | |     | | +-- es-to-primitive@1.2.0
| | |     | | | +-- is-callable@1.1.4 deduped
| | |     | | | +-- is-date-object@1.0.1
| | |     | | | `-- is-symbol@1.0.2
| | |     | | |   `-- has-symbols@1.0.0
| | |     | | +-- function-bind@1.1.1 deduped
| | |     | | +-- has@1.0.3 deduped
| | |     | | +-- is-callable@1.1.4 deduped
| | |     | | +-- is-regex@1.0.4
| | |     | | | `-- has@1.0.3 deduped
| | |     | | `-- object-keys@1.1.1 deduped
| | |     | `-- function-bind@1.1.1 deduped
| | |     `-- through@2.3.8
| | +-- fs-extra@8.0.1
| | | +-- graceful-fs@4.1.15
| | | +-- jsonfile@4.0.0
| | | | `-- graceful-fs@4.1.15 deduped
| | | `-- universalify@0.1.2
| | +-- glob@7.1.4
| | | +-- fs.realpath@1.0.0
| | | +-- inflight@1.0.6
| | | | +-- once@1.4.0 deduped
| | | | `-- wrappy@1.0.2
| | | +-- inherits@2.0.3
| | | +-- minimatch@3.0.4 deduped
| | | +-- once@1.4.0
| | | | `-- wrappy@1.0.2 deduped
| | | `-- path-is-absolute@1.0.1
| | +-- minimatch@3.0.4
| | | `-- brace-expansion@1.1.11
| | |   +-- balanced-match@1.0.0
| | |   `-- concat-map@0.0.1
| | +-- plist@3.0.1 deduped
| | +-- q@1.5.1 deduped
| | +-- strip-bom@3.0.0
| | +-- underscore@1.9.1
| | `-- which@1.3.1
| |   `-- isexe@2.0.0
| +-- elementtree@0.1.7
| | `-- sax@1.1.4
| +-- nopt@4.0.1
| | +-- abbrev@1.1.1
| | `-- osenv@0.1.5
| |   +-- os-homedir@1.0.2
| |   `-- os-tmpdir@1.0.2
| +-- properties-parser@0.3.1
| | `-- string.prototype.codepointat@0.2.1
| +-- q@1.5.1
| `-- shelljs@0.5.3
+-- cordova-ios@5.0.1
| +-- cordova-common@3.2.0 deduped
| +-- ios-sim@8.0.1
| | +-- bplist-parser@0.0.6
| | +-- nopt@1.0.9
| | | `-- abbrev@1.1.1 deduped
| | +-- plist@3.0.1 deduped
| | `-- simctl@2.0.0
| |   +-- shelljs@0.2.6
| |   `-- tail@0.4.0
| +-- nopt@4.0.1 deduped
| +-- plist@3.0.1
| | +-- base64-js@1.3.0
| | +-- xmlbuilder@9.0.7
| | `-- xmldom@0.1.27
| +-- q@1.5.1 deduped
| +-- shelljs@0.5.3 deduped
| +-- unorm@1.5.0
| +-- xcode@2.0.0
| | +-- simple-plist@1.0.0
| | | +-- bplist-creator@0.0.7
| | | | `-- stream-buffers@2.2.0
| | | +-- bplist-parser@0.1.1 deduped
| | | `-- plist@3.0.1 deduped
| | `-- uuid@3.3.2
| `-- xml-escape@1.1.0
+-- cordova-plugin-inappbrowser@3.0.0
+-- cordova-plugin-splashscreen@5.0.2
+-- cordova-plugin-statusbar@2.4.2
`-- cordova-plugin-whitelist@1.3.3
janpio commented 5 years ago

Not necessary, your output shows that you are already using the correct version.

@brodybits Can you take a look at the error in https://github.com/apache/cordova-ios/issues/575#issuecomment-503760454 to see if this could be related to the fs-extra stuff?

magancete commented 5 years ago

I solved it by updating my version of Node to 12.4.0

breautek commented 1 year ago

Closing as stale (5.x is out of support)