Giter Club home page Giter Club logo

Comments (16)

dpogue avatar dpogue commented on May 30, 2024 1

@janpio Regarding the node_modules folder, see apache/cordova#32

from cordova-cli.

janpio avatar janpio commented on May 30, 2024

Here the command to set up your environment this way:

git clone https://github.com/apache/cordova-coho.git
    cd cordova-coho & npm install & cd ..
    node cordova-coho/coho repo-clone -r mobile-spec -r tools -r plugins -r active-platforms
    node cordova-coho/coho npm-link

Should be enough to create a project with cordova-create and then try to install the locally checked out cordova-android.

from cordova-cli.

gandhirajan avatar gandhirajan commented on May 30, 2024

@janpio Hi Jan, I got the exact same error while trying to setup mobilespec project. I guess mobilespec project is looking for cordova-common module to be installed. This resembles the same problem which we discussed sometime back on slack regarding cordova-js module.

from cordova-cli.

janpio avatar janpio commented on May 30, 2024

No, the error is coming from cordova platform add ... with a local path - which createmobilespec is also executing. (This is actually how I got the idea to execute the above commands as I was debugging the mobilespec issue and ended up isolating it to this Cordova CLI call)

from cordova-cli.

gandhirajan avatar gandhirajan commented on May 30, 2024

But I m wondering how I was able to build this project successfully two releases back

from cordova-cli.

janpio avatar janpio commented on May 30, 2024

What does "this project" refer to?
Also: Probably because some part of the tooling (cli, common, etc) changed in the meantime - or you installed cordova-common correctly manually somehow.
But this should not be necessary.

from cordova-cli.

gandhirajan avatar gandhirajan commented on May 30, 2024

Was referring to mobilespec project Jan. I installed cordova-js dependency in cordova-lib module earlier to make it work

from cordova-cli.

janpio avatar janpio commented on May 30, 2024

Did you check if installing cordova-js in cordova-lib (cd cordova-lib & npm install cordova-js) still works for you?

from cordova-cli.

gandhirajan avatar gandhirajan commented on May 30, 2024

@janpio I tried it Jan but it didn't work. I m currently trying to include Cordova-common module as a dependency in mobilespec project by manually adding it but couldn't manage to do it. Did you managed to make it work?

from cordova-cli.

janpio avatar janpio commented on May 30, 2024

Please open a new issue at cordova-mobile-spec if you are having problems @gandhirajan

from cordova-cli.

janpio avatar janpio commented on May 30, 2024

Here are the command to a full repro, after setting up your system with the coho calls above:

# all Cordova projects were checked out to C:\Projects\cordova5 via coho
C:\Projects\cordova5\cordova-cli\bin\cordova create mobilespec_android org.apache.cordova.mobilespec MobileSpec_Tests --template cordova-mobile-spec\www
cd mobilespec_android 
C:\Projects\cordova5\cordova-cli\bin\cordova platform add "C:\Projects\cordova5\cordova-android" --verbose

(The exact same works for iOS as well)

from cordova-cli.

janpio avatar janpio commented on May 30, 2024

I debugged and understood the problem in apache/cordova-mobile-spec#159, so here is a copy of my last comment that has all the information:

I now have 2 apps with the Android platform added, one with master and one with 7.1.x: master is missing node_modules in platforms/android/cordova (which is created from https://github.com/apache/cordova-android/tree/master/bin/templates/cordova).

In 7.1.x this was copied there with this line:
https://github.com/apache/cordova-android/blob/7.1.x/bin/lib/create.js#L171

In master this is behind if (options.copyPlatformNodeModules):
https://github.com/apache/cordova-android/blob/master/bin/lib/create.js#L171

This was added in apache/cordova-android#536 by @erisu with the comment:

When platform is installed though CLI, cordova platform add android, the copy node_modules step is no longer valid as dependencies are now at the project level.
The step is required only when the create binary from the platform repo is called.

I was using the CLI to add the platform (C:\Projects\cordova5\cordova-cli\bin\cordova platform add "C:\Projects\cordova5\cordova-android" --verbose), so something went wrong there I guess :/

from cordova-cli.

janpio avatar janpio commented on May 30, 2024

The problem only manifests when installing master from a local path, not when it is installed from GitHub. (Then I encounter #363 though, but that's a separate problem)

from cordova-cli.

janpio avatar janpio commented on May 30, 2024

Thanks for the pointer, this indeed seems to be the reason - the PR I linked to here was a result of that issue.

from cordova-cli.

janpio avatar janpio commented on May 30, 2024

@erisu helped me confirm that this does not only happen on Windows and out of the context of coho etc. Here are the reproduction commands:

λ mkdir CordovaLocalPlatformFoo
λ cd CordovaLocalPlatformFoo
λ git clone http://github.com/apache/cordova-cli
λ git clone http://github.com/apache/cordova-android
λ cd cordova-cli
λ npm i
λ cd ..
λ cd cordova-android
λ npm i
λ cd ..

# variant 1: with `npm link`
λ cd cordova-cli
λ npm link
λ cd ..
λ cordova create test1
λ cd test1
λ cordova platform add ../cordova-android

# variant 2: without `npm link`
λ cordova-cli\bin\cordova create test2
λ cd test2
λ ..\cordova-cli\bin\cordova platform add "../cordova-android"

from cordova-cli.

raphinesse avatar raphinesse commented on May 30, 2024

I just ran the following commands on my machine successfully (extracted from your reproduction listing @janpio):

git clone http://github.com/apache/cordova-cli && cd cordova-cli
npm i
npm link
cd ..

git clone http://github.com/apache/cordova-android && cd cordova-android
npm i
cd ..

cordova create test1 && cd test1

cordova platform add ../cordova-android

Works for me, YMMV. Closing for now.

from cordova-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.