Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error "error Couldn't find package "XXX" when building project on CI pipeline and when trying to add packages via Yarn

After returning to our project after the weekend my team was met with the error "error Couldn't find package "3d-view@^2.0.0" required by "gl-plot3d@^2.4.2" on the "npm" registry." on our CI pipeline during the install phase. Additionally, this error occurred when trying to add packages with yarn, terminating the process.

This error is happening on the front-end side of our project and doesn't show up upon starting it normally via yarn start. On the last push before the weekend everything went normal without any errors.

Log of our CI job starting at the install command:

$ yarn install
 yarn install v1.17.3
 info No lockfile found.
 [1/4] Resolving packages...
 warning @material-ui/core > [email protected]: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
 warning moments > myconf > babel > babel-core > [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
 warning moments > myconf > babel > babel-core > [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
 warning plotly.js > regl-splom > [email protected]: use String.prototype.padStart()
 warning plotly.js > ndarray-fill > cwise > static-module > through2 > xtend > [email protected]: 
 warning plotly.js > point-cluster > bubleify > buble > [email protected]: This is not needed anymore. Use `require('os').homedir()` instead.
 error Couldn't find package "3d-view@^2.0.0" required by "gl-plot3d@^2.4.2" on the "npm" registry.
 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Our .gitlab-ci.yml code:

stages:
  - build
#  - test
#  - deploy

before_script:
#  - echo `pwd` # debug
#  - echo "$CI_BUILD_NAME, $CI_COMMIT_REF_NAME $CI_BUILD_STAGE" # debug
  - export GRADLE_USER_HOME=`pwd`/.gradle
  - unset CI

cache:
  paths:
    - .gradle/wrapper
    - .gradle/caches

build backend:
  image: gradle:6.1-jdk8
  stage: build
  script:
    - cd backend
    - gradle war

    
  artifacts:
    paths:
      - backend/build/libs/*.jar
    expire_in: 1 week
    
build frontend:
  image: node:10.16.3
  stage: build
  script:
    - cd frontend
    - yarn install
    - export NODE_OPTIONS=--max_old_space_size=4096
    - yarn build

Dependencies in package.json:

 "dependencies": {
    "@material-ui/core": "^4.9.0",
    "@material-ui/icons": "^4.5.1",
    "@testing-library/jest-dom": "^4.2.4",
    "@testing-library/react": "^9.3.2",
    "@testing-library/user-event": "^7.1.2",
    "axios": "^0.19.2",
    "moments": "^0.0.2",
    "plotly.js": "^1.52.1",
    "react": "^16.12.0",
    "react-dom": "^16.12.0",
    "react-plotly.js": "^2.4.0",
    "react-scripts": "3.3.0"
  }

We are clueless of how this could happen, as nobody pushed anything to the branch in the meantime and was noticed when a team member was pushing a cleaned up version of our code and another was trying to install a new package via Yarn.

like image 973
Felix Bloch Avatar asked Feb 12 '20 08:02

Felix Bloch


1 Answers

I was able to fix installing the missing package manually:

sudo npm i git://github.com/mikolalysenko/3d-view
sudo npm install
like image 51
Diogo Falcão Avatar answered Nov 10 '22 12:11

Diogo Falcão