Encountered issues with installing Phoenix Framework npm dependencies (phoenix & phoenix_html) during Travis CI setup

I recently encountered an issue while testing my Phoenix Framework project with Travis CI. Initially, everything was running smoothly with only Elixir tests.

However, when I attempted to add some JavaScript tests, I ran into a roadblock. The problem stemmed from the fact that I couldn't resolve phoenix and phoenix_html due to them being linked to local Phoenix dependencies in my package.json:

"dependencies": {
  "ava": "^0.18.2",
  ...
  "phoenix": "file:deps/phoenix",
  "phoenix_html": "file:deps/phoenix_html",
  "react": "^15.4.2"
  ...
},

This resulted in a crash on Travis due to a permission issue:

...
The command "mix test" exited with 0.
1.37s$ npm install
-\npm ERR! git clone github.com/file/deps/phoenix Cloning into bare repository '/home/travis/.npm/_git-remotes/git-github-com-file-deps-phoenix-c83d6c1a'...
npm ERR! git clone github.com/file/deps/phoenix Warning: Permanently added the RSA host key for IP address '192.30.253.112' to the list of known hosts.
npm ERR! git clone github.com/file/deps/phoenix Permission denied (publickey).
npm ERR! git clone github.com/file/deps/phoenix fatal: Could not read from remote repository.
\npm ERR! git clone github.com/file/deps/phoenix_html Cloning into bare repository '/home/travis/.npm/_git-remotes/git-github-com-file-deps-phoenix-html-50a27b71'...
npm ERR! git clone github.com/file/deps/phoenix_html Permission denied (publickey).
npm ERR! git clone github.com/file/deps/phoenix_html fatal: Could not read from remote repository.
npm ERR! notarget No compatible version found: react-hot-loader@'>=4.0.0-0 <5.0.0-0'
... 

Answer №1

After some investigation, I discovered that the 'node_js' was not functioning properly when using languages other than node. This issue arose because the node version being used was v0.10.36, as indicated by the error log.

Unfortunately, local dependencies do not work with such an outdated version of node, leading to a failure.

To resolve this issue, I had to install a specific version of node using nvm and adjust some elixir scripts due to hook overwrites. Here is what I did:

language: elixir
elixir:
  - 1.4.1
otp_release:
  - 19.0
sudo: false
addons:
  postgresql: '9.4'
env:
  - NODE_VERSION="7.7.2"
before_install:
  - mix local.rebar --force
  - mix local.hex --force
  - nvm install $NODE_VERSION
install:
  - mix deps.get
  - yarn install
before_script:
  - mix do ecto.create, ecto.migrate
script:
  - mix test
  - yarn test

I'm curious if there is a way to streamline this process by declaring the elixir and node.js environments together?

Answer №2

Encountering issues with your git clone process.

To resolve, update your git configuration to

git config --global url.https://github.com/ 

in place of git://github.com/

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

External vendor scripts such as JavaScript and jQuery are not functioning properly after being rendered in a ReactJS environment

I am currently developing a frontend web app using ReactJS. I obtained a template from W3layout that is built with HTML5, CSS3, and custom JS files, along with various third-party/vendor plugins like nice-select, bootstrap, slik, owl-carousel, etc. Despit ...

What is the process for transmitting data in JSON format generated by Python to JavaScript?

Utilizing Python libraries cherrypy and Jinja, my web pages are being served by two Python files: Main.py (responsible for handling web pages) and search.py (containing server-side functions). I have implemented a dynamic dropdown list using JavaScript w ...

ensure Selenium waits for animation to finish

I've encountered a problem regarding waiting for an animation to complete. Previously, I could rely on Selenium functions like wait.until(ExpectedConditions.... However, this is no longer sufficient. The element in question can be found in the HT ...

Updating presence of HTML tag link based on ng-if condition

HTML: <a data-ng-if="price" data-ng-click="selected(price)"> <div> ... </div> </a> i am trying to figure out how to remove the <a></a> element when data-ng-if="!price" Can anyone provide guidance on th ...

Conceal a section if the array is not defined

Hey there, I've got this piece of code for checking the status of a Twitch streamer. $(document).ready(function () { // some initializations here var login = ''; var twitchStatusLinks = $('.twitch-status'); var twitchStatus ...

Analyzing all the <option> elements within a <select> tag with jQuery

I have a WordPress plugin in development and I am currently facing an issue with comparing user-input from an <input> element to a set of <option> elements within a <select> element. Here is my current approach: $('button#test_bu ...

Is it possible to update the content within an HTML paragraph without deleting the existing span elements

Check out this code snippet below from jquery UI, showcasing an alert box: <div class="ui-widget"> <div class="ui-state-error ui-corner-all" style="padding: 0 .7em;"> <p><span class="ui-icon ui-icon-alert" style="float: le ...

reviewing the content of an element upon mouse hover

I'm having trouble setting up a mouse enter event that should trigger if the element contains specific text. However, for some reason, it seems like the :contains parameter is not being recognized. Here is the HTML: <div class="sample">red< ...

Using the Conditional Operator with Protected Routes in ReactJS

It seems like a minor issue I'm facing. In my app, users can subscribe through "stripe" and I want to grant access to specific URLs based on their subscription. If not subscribed, they should be redirected to the "profile" page. I'm encounterin ...

Retrieve the values of two inputs from outside of the event

How can I access the values of two input fields in order to perform calculations as soon as their values are updated? <script> // Accessing the values of the two input fields for immediate calculation based on user input const heightInputEl = docum ...

The popup.html file was overlooked during the generation of the Chrome extension build with Vite

I'm currently utilizing a github CLI plugin found at this link to set up mv3 chrome extensions using vue and vite. The initial template is properly set up and I can work on it without any issues. However, I encounter a problem when trying to utilize ...

Error: Attempting to access properties of an undefined value (reading '0') within the Array.map function

Take a look at this image illustrating the issue I'm facing export const FlipData = [ { id: "1", tittle: "IT Manpower Consultant", points: [ "Devops and IT consulting", "Renting Servers&quo ...

The request is unsuccessful due to the absence of the 'Access-Control-Allow-Origin' header

I've set up a form using Get Response (the email client) and I'm attempting to implement ajax in order to display a custom success or failure message upon submission. The code seems to be functioning correctly. However, as soon as I connect the a ...

Using callback functions in a JavaScript AJAX request

I am currently working on a function to handle an Ajax request with a callback. The main goal of this code is to send a request and display the response within a div element on my HTML page. However, I have been facing issues with the callback functionalit ...

Mastering the BFCache management in React for optimal performance

Before redirecting to an external payment provider, I display a loading screen to account for longer load times. If the user decides not to complete the payment and navigates back using gestures or the browser's back button, the page is pulled from t ...

Unable to add content to jQuery wrap

Why is it that you cannot append an element to the one used for wrapping another - as shown in the example below? var $test = $('.test'), $test1 = $('.test1'), $move = $('.move'), $testWrapper = $('<div ...

What is causing the "bad control character" error when attempting to parse JSON with Chinese characters included?

I currently have a typical HTML5 client/server arrangement in place. The server side mainly consists of Java, while the client side is built with JavaScript. I make use of ajax to send queries and receive responses. So far, everything has been running smoo ...

How can one transfer information from a client to a server and complete a form using JavaScript?

Can the information be transferred from a client to the server using just JS, then fill out a form on the server, and finally redirect the client to view a pre-filled form? I am considering utilizing AJAX to send a JSON object, but unsure if it will be s ...

Comparing Performance: Ajax with JSON Versus Text

I'm feeling a bit puzzled and was hoping to get some insight from one of you. I want to optimize the performance of my Ajax request. The data being transmitted is a table with 1,000 rows and 10 columns. The question at hand is: should I transmit it as ...

Combining objects while utilizing SetState within a loop: a guide

Inside my component, the state is structured as follows: class MainClass constructor(props) { super(props); this.state = { form: { startDate:"1/11/2020", endDate:"5/11/2020", .... }, ...