Comments (16)
@janpio Regarding the node_modules folder, see apache/cordova#32
from cordova-cli.
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.
@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.
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.
But I m wondering how I was able to build this project successfully two releases back
from cordova-cli.
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.
Was referring to mobilespec project Jan. I installed cordova-js dependency in cordova-lib module earlier to make it work
from cordova-cli.
Did you check if installing cordova-js
in cordova-lib
(cd cordova-lib & npm install cordova-js
) still works for you?
from cordova-cli.
@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.
Please open a new issue at cordova-mobile-spec if you are having problems @gandhirajan
from cordova-cli.
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.
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 with7.1.x
:master
is missingnode_modules
inplatforms/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#L171In
master
this is behindif (options.copyPlatformNodeModules)
:
https://github.com/apache/cordova-android/blob/master/bin/lib/create.js#L171This 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.
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.
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.
@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.
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)
- Should we give up cordova? HOT 1
- Updation of transitive dependency [email protected] to version greater than 12.1.0 HOT 4
- Template directory on read-only filesystem makes cordova crash HOT 8
- TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator)) HOT 5
- Cordova cli is installing a very old plugin HOT 4
- Update the macos-release package to 3.1.0 to include macos 13 HOT 1
- Build failing when edit-config tag is added to config.xml HOT 1
- 'cordova build ios' taking over 5 minutes to compile and displaying verbose info in terminal HOT 6
- '--searchpath' not working properly on Cordova 11.1
- Cordova has dependencies which use deprecated libraries HOT 4
- 'cordova platform add windows' broken HOT 1
- Create has error on WSL HOT 3
- Optionally serve browser platform over HTTPS HOT 2
- SyntaxError: Unexpected token while upgrade cordova 11.0.0 to 12.0.0 on ios HOT 6
- Cordova 12.0.0 - JAVA Warning on project import to Android Studio (Electric Eel 2022.1.1) HOT 1
- Insight dependency with open CVE HOT 1
- Cordova-cli on MacOS Ventura? HOT 2
- Supporting Windows Platform HOT 1
- Script for plugin hook "after_plugin_rm" does not work
- splash art causes unhelpful error traces HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-cli.