sheltermanager / asm3

Animal Shelter Manager
GNU General Public License v3.0
108 stars 64 forks source link

NPX not found when trying to build #843

Closed julian-poidevin closed 4 years ago

julian-poidevin commented 4 years ago

After re-syncing my local ASM3 repo with yours, I'm having the following errors when building.

I tried to to a make deps but no luck.

For info I'm running node v8.10.0.

root@vps759328:~/repo/asm3# make all
[clean] ============================
rm -f src/static/js/min/*.min.js
rm -f cscope*
rm -f tags
rm -f src/*.pyc
rm -rf src/__pycache__
rm -f src/asm3/*.pyc
rm -rf src/asm3/__pycache__
rm -f src/asm3/dbms/*.pyc
rm -rf src/asm3/dbms/__pycache__
rm -f src/asm3/locales/*.pyc
rm -rf src/asm3/locales/__pycache__
rm -f src/asm3/paymentprocessor/*.pyc
rm -rf src/asm3/paymentprocessor/__pycache__
rm -f src/asm3/pbkdf2/*.pyc
rm -rf src/asm3/pbkdf2/__pycache__
rm -f src/asm3/publishers/*.pyc
rm -rf src/asm3/publishers/__pycache__
[compile javascript] =================
for i in src/static/js/*.js; do echo $i; npx jshint --config scripts/jshint.conf $i; done
src/static/js/accounts.js
/bin/sh: 1: npx: not found
src/static/js/accounts_trx.js
/bin/sh: 1: npx: not found
src/static/js/additional.js
/bin/sh: 1: npx: not found
src/static/js/animal.js
/bin/sh: 1: npx: not found
src/static/js/animal_bulk.js
/bin/sh: 1: npx: not found
src/static/js/animal_costs.js
/bin/sh: 1: npx: not found
src/static/js/animal_diet.js
/bin/sh: 1: npx: not found
src/static/js/animal_find.js
/bin/sh: 1: npx: not found
src/static/js/animal_find_results.js
/bin/sh: 1: npx: not found
src/static/js/animal_new.js
/bin/sh: 1: npx: not found
src/static/js/animal_view_adoptable.js
/bin/sh: 1: npx: not found
src/static/js/batch.js
/bin/sh: 1: npx: not found
src/static/js/calendarview.js
/bin/sh: 1: npx: not found
src/static/js/change_password.js
/bin/sh: 1: npx: not found
src/static/js/change_user_settings.js
/bin/sh: 1: npx: not found
src/static/js/citations.js
/bin/sh: 1: npx: not found
src/static/js/clinic_appointment.js
/bin/sh: 1: npx: not found
src/static/js/clinic_calendar.js
/bin/sh: 1: npx: not found
src/static/js/clinic_invoice.js
/bin/sh: 1: npx: not found
src/static/js/common.js
/bin/sh: 1: npx: not found
src/static/js/common_animalchooser.js
/bin/sh: 1: npx: not found
src/static/js/common_animalchoosermulti.js
/bin/sh: 1: npx: not found
src/static/js/common_map.js
/bin/sh: 1: npx: not found
src/static/js/common_personchooser.js
/bin/sh: 1: npx: not found
src/static/js/common_tableform.js
/bin/sh: 1: npx: not found
src/static/js/common_widgets.js
/bin/sh: 1: npx: not found
src/static/js/csvexport.js
/bin/sh: 1: npx: not found
src/static/js/csvimport.js
/bin/sh: 1: npx: not found
src/static/js/csvimport_paypal.js
/bin/sh: 1: npx: not found
src/static/js/diary.js
/bin/sh: 1: npx: not found
src/static/js/diarytask.js
/bin/sh: 1: npx: not found
src/static/js/diarytasks.js
/bin/sh: 1: npx: not found
src/static/js/document_edit.js
/bin/sh: 1: npx: not found
src/static/js/document_repository.js
/bin/sh: 1: npx: not found
src/static/js/document_templates.js
/bin/sh: 1: npx: not found
src/static/js/donation_receive.js
/bin/sh: 1: npx: not found
src/static/js/donations.js
/bin/sh: 1: npx: not found
src/static/js/giftaid_hmrc_spreadsheet.js
/bin/sh: 1: npx: not found
src/static/js/header.js
/bin/sh: 1: npx: not found
src/static/js/header_additional.js
/bin/sh: 1: npx: not found
src/static/js/header_edit_header.js
/bin/sh: 1: npx: not found
src/static/js/htmltemplates.js
/bin/sh: 1: npx: not found
src/static/js/incident.js
/bin/sh: 1: npx: not found
src/static/js/incident_find.js
/bin/sh: 1: npx: not found
src/static/js/incident_find_results.js
/bin/sh: 1: npx: not found
src/static/js/incident_map.js
/bin/sh: 1: npx: not found
src/static/js/incident_new.js
/bin/sh: 1: npx: not found
src/static/js/latency.js
/bin/sh: 1: npx: not found
src/static/js/licence.js
/bin/sh: 1: npx: not found
src/static/js/licence_renewal.js
/bin/sh: 1: npx: not found
src/static/js/litters.js
/bin/sh: 1: npx: not found
src/static/js/log.js
/bin/sh: 1: npx: not found
src/static/js/log_new.js
/bin/sh: 1: npx: not found
src/static/js/login.js
/bin/sh: 1: npx: not found
src/static/js/lookups.js
/bin/sh: 1: npx: not found
src/static/js/lostfound.js
/bin/sh: 1: npx: not found
src/static/js/lostfound_find.js
/bin/sh: 1: npx: not found
src/static/js/lostfound_find_results.js
/bin/sh: 1: npx: not found
src/static/js/lostfound_new.js
/bin/sh: 1: npx: not found
src/static/js/mailmerge.js
/bin/sh: 1: npx: not found
src/static/js/mailmerge_criteria.js
/bin/sh: 1: npx: not found
src/static/js/main.js
/bin/sh: 1: npx: not found
src/static/js/media.js
/bin/sh: 1: npx: not found
src/static/js/medical.js
/bin/sh: 1: npx: not found
src/static/js/medicalprofile.js
/bin/sh: 1: npx: not found
src/static/js/mobile.js
/bin/sh: 1: npx: not found
src/static/js/mobile_sign.js
/bin/sh: 1: npx: not found
src/static/js/move_adopt.js
/bin/sh: 1: npx: not found
src/static/js/move_deceased.js
/bin/sh: 1: npx: not found
src/static/js/move_foster.js
/bin/sh: 1: npx: not found
src/static/js/move_gendoc.js
/bin/sh: 1: npx: not found
src/static/js/move_reclaim.js
/bin/sh: 1: npx: not found
src/static/js/move_reserve.js
/bin/sh: 1: npx: not found
src/static/js/move_retailer.js
/bin/sh: 1: npx: not found
src/static/js/move_transfer.js
/bin/sh: 1: npx: not found
src/static/js/movements.js
/bin/sh: 1: npx: not found
src/static/js/onlineform.js
/bin/sh: 1: npx: not found
src/static/js/onlineform_extra.js
/bin/sh: 1: npx: not found
src/static/js/onlineform_incoming.js
/bin/sh: 1: npx: not found
src/static/js/onlineforms.js
/bin/sh: 1: npx: not found
src/static/js/options.js
/bin/sh: 1: npx: not found
src/static/js/person.js
/bin/sh: 1: npx: not found
src/static/js/person_find.js
/bin/sh: 1: npx: not found
src/static/js/person_find_results.js
/bin/sh: 1: npx: not found
src/static/js/person_investigation.js
/bin/sh: 1: npx: not found
src/static/js/person_links.js
/bin/sh: 1: npx: not found
src/static/js/person_new.js
/bin/sh: 1: npx: not found
src/static/js/publish.js
/bin/sh: 1: npx: not found
src/static/js/publish_logs.js
/bin/sh: 1: npx: not found
src/static/js/publish_options.js
/bin/sh: 1: npx: not found
src/static/js/report.js
/bin/sh: 1: npx: not found
src/static/js/report_criteria.js
/bin/sh: 1: npx: not found
src/static/js/report_export.js
/bin/sh: 1: npx: not found
src/static/js/report_images.js
/bin/sh: 1: npx: not found
src/static/js/reports.js
/bin/sh: 1: npx: not found
src/static/js/roles.js
/bin/sh: 1: npx: not found
src/static/js/rota.js
/bin/sh: 1: npx: not found
src/static/js/search.js
/bin/sh: 1: npx: not found
src/static/js/shelterview.js
/bin/sh: 1: npx: not found
src/static/js/sql.js
/bin/sh: 1: npx: not found
src/static/js/staff_rota.js
/bin/sh: 1: npx: not found
src/static/js/stocklevel.js
/bin/sh: 1: npx: not found
src/static/js/task.js
/bin/sh: 1: npx: not found
src/static/js/test.js
/bin/sh: 1: npx: not found
src/static/js/timeline.js
/bin/sh: 1: npx: not found
src/static/js/transport.js
/bin/sh: 1: npx: not found
src/static/js/traploan.js
/bin/sh: 1: npx: not found
src/static/js/users.js
/bin/sh: 1: npx: not found
src/static/js/vaccination.js
/bin/sh: 1: npx: not found
src/static/js/vouchers.js
/bin/sh: 1: npx: not found
src/static/js/waitinglist.js
/bin/sh: 1: npx: not found
src/static/js/waitinglist_new.js
/bin/sh: 1: npx: not found
src/static/js/waitinglist_results.js
/bin/sh: 1: npx: not found
Makefile:91: recipe for target 'compilejs' failed
make: *** [compilejs] Error 127
julian-poidevin commented 4 years ago

I progressed into the issue by doing npm i -g npx. Now having the following warning :

[compat] ==============================
mkdir -p src/static/js/compat
rm -f src/static/js/compat/*.min.js
npx babel -d src/static/js/compat src/static/js/*.js
npx: installed 1 in 3.72s
You have mistakenly installed the `babel` package, which is a no-op in Babel 6.
Babel's CLI commands have been moved from the `babel` package to the `babel-cli` package.

    npm uninstall -g babel
    npm install --save-dev babel-cli
julian-poidevin commented 4 years ago

After installing babel and compiling again, I have the following error :

[compat] ==============================
mkdir -p src/static/js/compat
rm -f src/static/js/compat/*.min.js
npx babel -d src/static/js/compat src/static/js/*.js
Couldn't find preset "@babel/preset-env" relative to directory "/root/repo/asm3"
Makefile:57: recipe for target 'compat' failed
make[1]: *** [compat] Error 1
make[1]: Leaving directory '/root/repo/asm3'

/root/repo/asm3 is the path where my asm3 repo is cloned

bobintetley commented 4 years ago

Hi Julian, npx is part of npm and should install with it? Installing the Debian nodejs package should include it.

You've installed Babel 6, but we depend on Babel 7 and some other packages. The package.json and package-lock.json files have the exact dependencies and it should just be a case of running "npm install" in the root of the source to create node_modules and install everything. I will add that to make deps.

bobintetley commented 4 years ago

just to make sure, remove any changes to package*.json in your local env/branch and delete the node_modules folder. Then run npm install to get the deps.

julian-poidevin commented 4 years ago

Oh, I though it was a deps missing in the Makefile... I know the issues are not supposed to be used to ask for support, I'm sorry.

I'm also surprised but seems npx what not installed along npm on my server (Ubuntu)... Should you update the Makefile to force the install ?

After following your instructions everything runs smoothly. I was not familiar with npm.

Thanks a lot !