I encountered a hiccup while trying to add the android platform to my cordova project. Any assistance or guidance would be greatly appreciated

As a beginner in Cordova, I am diving into the world of cross-platform hybrid app development. However, I encountered an error when trying to add the Android platform using cordova platform add android. Unfortunately, I am unsure how to resolve this issue.

No version supplied. Retrieving version from config.xml...
npm http GET https://registry.npmjs.oorg/cordova-android/-/cordova-android-4.0.0.tgz
TypeError: Request path contains unescaped characters.
    at new Client Request (_http_client.js:73:10)
    at Tunneling Agent.exports.request (http.js:49:10)
    at TunnelingAgent.createSocket(C:\Users\Administrator\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\npm\node_modules\request\node_modules\tunnel-agent\index.js:117:25)
    at TunnelingAgent.createSecureSocket [as createSocket] (C:\Users\Administrator\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\npm\node_modules\request\node_modules\tunnel-agent\index.js:184:41)
    at TunnelingAgent.addRequest (C:\Users\Administrator\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\npm\node_modules\request\node_modules\tunnel-agent\index.js:80:8)
    at new ClientRequest (_http_client.js:154:16)
    at Object exports.request (http.js:49:10)
    at Object exports.request (https.js:136:15)
    at Request.start (C:\Users\Administrator\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\npm\node_modules\request\index.js:594:30)
    at Request.end(C:\Users\Administrator\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\npm\node_modules\request\index.js:1186:28)

Any assistance would be greatly appreciated.

Answer №1

A potential issue may exist with Node and the CLI which could be causing a bug. One suggested solution is as follows:

To begin, adjust the proxy settings:

npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080

Replace the content of tunnel-agent with the contents found in this zip file - tunnel-agent

You will need to locate your tunnel-agent folder in two different locations:

C:\Users\Administrator\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\request\node_modules\tunnel-agent

and

C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\request\node_modules\tunnel-agent

If you are using a 32-bit system and cannot locate the Program Files (x86) directory, please check the Program Files folder instead.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What functionality does the --use-npm flag serve in the create-next-app command?

When starting a new NextJS project using the CLI, there's an option to use --use-npm when running the command npx create-next-app. If you run the command without any arguments (in interactive mode), this choice isn't provided. In the documentati ...

using the ng2-accordion component in your Angular 2 project

I am having trouble with the angular-2 accordion I implemented. It is not functioning properly and throwing a 404 error. The issue seems to be related to a third-party plugin called "ng2-accordion." I have double-checked the path of the package and it is ...

Is there a way to incorporate Beta versions into the `npm outdated` command?

When I run npm outdated, it shows the following: Package Current Wanted Latest bootstrap 4.0.0-beta 4.0.0-beta 3.3.7 I want to hide this information because I've already specified the correct version, and npm is not r ...

Node.js causing NPM error message to pop up consistently each time I launch the terminal

Hey there! Every time I open my terminal on my MacBook (OSX 10.15.4), I encounter this error message: /Users/anarenault/.nvm/v0.10.48/lib/node_modules/npm/bin/npm-cli.js:85 let notifier = require('update-notifier')({pkg}) ^^^^^^ ...

What is the best way to execute the command "npm run watch" on a server for a Laravel project?

Seeking assistance with an issue I've encountered – I can't find the solution on my own. I am currently attempting to immediately update changes made in the code using "np m run watch", but I'm unsure how to do so on the server. All the f ...

Tips for ensuring webpack reflects changes made to your JavaScript code while using lite-server

Is it feasible to have webpack reflect JavaScript changes instantly when lite-server is running through npm? Currently, I find myself having to run npm build every time there are updates in my JavaScript files. Lute-server efficiently updates CSS changes ...

Errors related to TypeScript syntax have been detected within the node_modules/discord.js/typings/index.d.ts file for Discord.JS

I keep encountering typescript syntax errors after pulling from my git repository, updating all npm modules on the server, and running the start script. The errors persist even when using npm run dev or npx tsc. I've attempted the following troublesh ...

Encountering difficulties during the installation of tensorflow.js using npm

I attempted to install the necessary package using the command provided in the tensorflow documentation: npm install -g @tensorflow/tfjs-node Despite my best efforts, I have been unable to identify a solution to the problem. Any assistance in resolving th ...

I'm wondering if it's possible to fork an npm library in package.json and automatically trigger its build process upon installation

I am currently facing an issue with a npm dependency, such as ngx-infinite-scroll, that I am trying to fork for bug fixes. I want to include my modified version as a dependency in my application. Here is an example of how I have included it in my package.j ...

installing packages globally in npm with elevated permissions and disregarding security precautions

Attempting to install an npm module by running the command: sudo npm install -g now However, during this process, a warning is encountered: Warning! It is advised to reinstall Now CLI with the option --unsafe-perm. For instance: npm i -g --unsafe ...

Are the dependencies of a Node module not updating properly after being updated or installed?

I recently integrated react-highcharts into my application. After using npm install react-highcharts, the installation was successful, but with a warning message: found 1 high severity vulnerability, run `npm audit fix` to fix them, or `npm audit` for deta ...

The perfect pairing: Visual Studio and Gulp

Having trouble running Gulp in Visual Studio for an angular app, I encountered the following error message: Cannot evaluate the item metadata "%(FullPath)". The item metadata "%(FullPath)" cannot be applied to the path "node_modules\gulp\node_m ...

PUG Parser Error: Unexpected token found at line 12, character 15

Regardless of whether I utilize gulp pug or just pug, this error keeps popping up: SyntaxError: Unexpected token (12:15) at Parser.pp$4.raise (C:\Users\freet\AppData\Roaming\npm\node_modules\pug\node_modules&bso ...

What are effective ways to bypass proxy configurations when setting up npm and its corresponding plugins?

I'm facing a challenge with the proxy settings on my machine as I am not authorized to make changes to them. Despite this, I have installed node.js. Is there a method to override proxy and https-proxy settings via code so I can successfully install np ...

Issue with using puppeteer for testing applications

Having an issue as a beginner in JavaScript, I'm struggling to solve this error. I am fetching data from a website using puppeteer and trying to verify if it's the correct one: const puppeteer = require('puppeteer'); (async () => { ...

What sets apart dependencies, devDependencies, and peerDependencies within an NPM package.json file?

I found this documentation to be inadequate in addressing my question. The explanations provided were difficult for me to grasp. Can someone please explain it more simply, perhaps with the help of examples if necessary? Additionally, I am also confused ab ...

Issue encountered while running npm install #7884 - npm warns of locking error: EACCES

I encountered an error while trying to npm install concat-map. I have already tried adding sudo. npm install concat-map npm WARN locking Error: EACCES, open '/Users/mercadotecnia/.npm/_locks/concat-map-a127112b4f6ee84c.lock' npm WARN locking /U ...

Error: Unable to locate the module 'encoding' in the specified directory '/vercel/path0/node_modules/cross-fetch/node_modules/node-fetch/lib'

Has anyone encountered the warning issue related to non-breaking changes with the npm package @supabase/supabase-js? The warning message: warn - ./node_modules/cross-fetch/node_modules/node-fetch/lib/index.js Module not found: Can't resolve 'en ...

Incorporating personalized fonts into React webpack bundling

I've been working on a ReactJS component to be published on npmjs. I successfully added custom fonts as tff files using webpack, and they are displaying properly in the development mode. However, when switching to production mode, the fonts are not be ...

The Jenkins build process is encountering errors while trying to generate lighthouse reports

Fri, 28 May 2021 09:27:18 GMT ChromeLauncher Waiting for browser............................................................................................. Fri, 28 May 2021 09:27:19 GMT ChromeLauncher Waiting for browser.................................. ...