Project

General

Profile

Bug #36373

build failes, if there is no system-wide NPM installation: `ng` not found

Added by Sebastian Wagner about 2 years ago. Updated almost 2 years ago.

Status:
Resolved
Priority:
Normal
Category:
dashboard/general
Target version:
-
% Done:

0%

Source:
Community (dev)
Tags:
Backport:
Regression:
Yes
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature:

Description

Running make fails

634effb2f216:/ceph/build/src/pybind/mgr/dashboard # make
[  0%] Built target mgr-dashboard-nodeenv
[  0%] dashboard frontend dependencies are being installed
/ceph/build/src/pybind/mgr/dashboard/node-env/bin/npm -> /ceph/build/src/pybind/mgr/dashboard/node-env/lib/node_modules/npm/bin/npm-cli.js
/ceph/build/src/pybind/mgr/dashboard/node-env/bin/npx -> /ceph/build/src/pybind/mgr/dashboard/node-env/lib/node_modules/npm/bin/npx-cli.js
+ npm@6.2.0
added 282 packages, removed 363 packages and updated 41 packages in 5.401s
npm ERR! code ENOGIT
npm ERR! Error while executing:
npm ERR! undefined ls-remote -h -t ssh://git@github.com/zzakir/ng2-toastr.git
npm ERR! 
npm ERR! undefined
npm ERR! No git binary found in $PATH
npm ERR! 
npm ERR! Failed using git.
npm ERR! Please check if you have git installed and in your PATH.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-10-10T08_51_15_951Z-debug.log
make[2]: *** [src/pybind/mgr/dashboard/CMakeFiles/mgr-dashboard-frontend-deps.dir/build.make:61: ../src/pybind/mgr/dashboard/frontend/node_modules] Error 1
make[1]: *** [CMakeFiles/Makefile2:5054: src/pybind/mgr/dashboard/CMakeFiles/mgr-dashboard-frontend-deps.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

I can reproduce it:

634effb2f216:/ceph/src/pybind/mgr/dashboard/frontend # . /ceph/build/src/pybind/mgr/dashboard/node-env/bin/activate
(node-env) 634effb2f216:/ceph/src/pybind/mgr/dashboard/frontend # /ceph/build/src/pybind/mgr/dashboard/node-env/bin/npm run build

> ceph-dashboard@0.0.0 build /ceph/src/pybind/mgr/dashboard/frontend
> ng build

sh: ng: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! ceph-dashboard@0.0.0 build: `ng build`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the ceph-dashboard@0.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-10-10T08_58_26_555Z-debug.log

Looks like npm calls ng which is not installed correctly in on of these dirs:

/ceph/build/src/pybind/mgr/dashboard/node-env/lib/node_modules/.bin
/ceph/build/src/pybind/mgr/dashboard/node-env/bin

Right! it's not installed:

(node-env) 634effb2f216:/ceph/build/src/pybind/mgr/dashboard/node-env/lib/node_modules # find * -name ng | wc -l
0

Deleting the `node_modules` folder doesn't help.

Environemnt

  • Current git master
  • openSUSE LEap 15 docker container

History

#1 Updated by Sebastian Wagner about 2 years ago

  • Description updated (diff)

Running

npm install  @angular/cli@latest

Doesn't install ng:

(node-env) 634effb2f216:/ceph/src/pybind/mgr/dashboard/frontend # npm install  @angular/cli@latest

> node-sass@4.9.3 install /ceph/src/pybind/mgr/dashboard/frontend/node_modules/node-sass
> node scripts/install.js

Cached binary found at /root/.npm/node-sass/4.9.3/linux-x64-57_binding.node

> node-sass@4.9.3 postinstall /ceph/src/pybind/mgr/dashboard/frontend/node_modules/node-sass
> node scripts/build.js

Binary found at /ceph/src/pybind/mgr/dashboard/frontend/node_modules/node-sass/vendor/linux-x64-57/binding.node
Testing binary
Binary is fine
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ @angular/cli@6.2.4
added 1069 packages and updated 4 packages in 25.954s
(node-env) 634effb2f216:/ceph/src/pybind/mgr/dashboard/frontend # ng
bash: ng: command not found

#2 Updated by Sebastian Wagner about 2 years ago

Ok, looks like git is missing from install_deps.sh

#3 Updated by Sebastian Wagner about 2 years ago

  • Status changed from New to In Progress
  • Assignee set to Sebastian Wagner

#4 Updated by Sebastian Wagner about 2 years ago

  • Status changed from In Progress to Fix Under Review

#5 Updated by Tiago Melo almost 2 years ago

  • Status changed from Fix Under Review to Resolved

Also available in: Atom PDF