ngageoint / mage-server

Mobile Awareness GEOINT Environment Server
Apache License 2.0
88 stars 46 forks source link

npm install for Mage #84

Closed natesire closed 2 years ago

natesire commented 4 years ago

When I run npm install inside the Mage root dir... I receive an error...

colombia@colombia-desktop:/opt/mage$ sudo npm install npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 npm WARN deprecated nomnom@1.8.1: Package no longer supported. Contact support@npmjs.com for more info. npm WARN deprecated bson@1.0.9: Fixed a critical issue with BSON serialization documented in CVE-2019-2391, see https://bit.ly/2KcpXdo for more details npm WARN deprecated core-js@2.6.11: 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. npm ERR! Linux 4.15.0-101-generic npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" npm ERR! node v8.10.0 npm ERR! npm v3.5.2 npm ERR! code EMISSINGARG

npm ERR! typeerror Error: Missing required argument #1 npm ERR! typeerror at andLogAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:31:3) npm ERR! typeerror at fetchPackageMetadata (/usr/share/npm/lib/fetch-package-metadata.js:51:22) npm ERR! typeerror at resolveWithNewModule (/usr/share/npm/lib/install/deps.js:456:12) npm ERR! typeerror at /usr/share/npm/lib/install/deps.js:457:7 npm ERR! typeerror at /usr/share/npm/node_modules/iferr/index.js:13:50 npm ERR! typeerror at /usr/share/npm/lib/fetch-package-metadata.js:37:12 npm ERR! typeerror at addRequestedAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:82:5) npm ERR! typeerror at returnAndAddMetadata (/usr/share/npm/lib/fetch-package-metadata.js:117:7) npm ERR! typeerror at pickVersionFromRegistryDocument (/usr/share/npm/lib/fetch-package-metadata.js:134:20) npm ERR! typeerror at /usr/share/npm/node_modules/iferr/index.js:13:50 npm ERR! typeerror This is an error with npm itself. Please report this error at: npm ERR! typeerror http://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request: npm ERR! /opt/mage/npm-debug.log

newmanw commented 4 years ago

Unfortunately I have not seen this before. I would start here:

npm ERR! typeerror This is an error with npm itself. Please report this error at: npm ERR! typeerror http://github.com/npm/npm/issues

newmanw commented 4 years ago

Can you provide a bit more info?

OS and version? MAGE server version or branch? npm version? node version?

natesire commented 4 years ago

I made a little progress by using sudo and installing globally. I'll dig into it. It might just be a permissions error. A chmod or something. Not sure it's even a problem with Mage or this repo. Could be another npm module tripping it up.

natesire commented 4 years ago

I made some progress. I upgraded to Node 14. And I made sure /opt/mage is owned by my regular linux user, not root. New error though.... I'm like the tester guy on Sunday no one wants to hear from. hahahaha

node-pre-gyp WARN Using request for node-pre-gyp https download node-pre-gyp WARN Tried to download(404): https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.6.0/canvas-v2.6.0-node-v83-linux-glibc-x64.tar.gz node-pre-gyp WARN Pre-built binaries not found for canvas@2.6.0 and node@14.3.0 (node-v83 ABI, glibc) (falling back to source compile with node-gyp) /bin/sh: 1: pkg-config: not found gyp: Call to 'pkg-config pixman-1 --libs' returned exit status 127 while in binding.gyp. while trying to load binding.gyp gyp ERR! configure error gyp ERR! stack Error: gyp failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (/home/colombia/.nvm/versions/node/v14.3.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16) gyp ERR! stack at ChildProcess.emit (events.js:315:20) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12) gyp ERR! System Linux 4.15.0-101-generic gyp ERR! command "/home/colombia/.nvm/versions/node/v14.3.0/bin/node" "/home/colombia/.nvm/versions/node/v14.3.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/opt/mage/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/opt/mage/node_modules/canvas/build/Release" "--napi_version=6" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v83" gyp ERR! cwd /opt/mage/node_modules/canvas gyp ERR! node -v v14.3.0 gyp ERR! node-gyp -v v5.1.0 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute '/home/colombia/.nvm/versions/node/v14.3.0/bin/node /home/colombia/.nvm/versions/node/v14.3.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/opt/mage/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/opt/mage/node_modules/canvas/build/Release --napi_version=6 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1) node-pre-gyp ERR! stack at ChildProcess. (/opt/mage/node_modules/node-pre-gyp/lib/util/compile.js:83:29) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:315:20) node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1051:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5) node-pre-gyp ERR! System Linux 4.15.0-101-generic node-pre-gyp ERR! command "/home/colombia/.nvm/versions/node/v14.3.0/bin/node" "/opt/mage/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd /opt/mage/node_modules/canvas node-pre-gyp ERR! node -v v14.3.0 node-pre-gyp ERR! node-pre-gyp -v v0.11.0 node-pre-gyp ERR! not ok Failed to execute '/home/colombia/.nvm/versions/node/v14.3.0/bin/node /home/colombia/.nvm/versions/node/v14.3.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/opt/mage/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/opt/mage/node_modules/canvas/build/Release --napi_version=6 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1) npm WARN acorn-jsx@5.2.0 requires a peer of acorn@^6.0.0 || ^7.0.0 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! canvas@2.6.0 install: node-pre-gyp install --fallback-to-build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the canvas@2.6.0 install 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! /home/colombia/.npm/_logs/2020-05-24T14_18_52_494Z-debug.log

natesire commented 4 years ago

Resolved. I need to downgrade to node 9. In the package.json it says the engine is required to be between specific version. I'll fork the README add update the directions just a tad. And add a warning about setting the /opt/mage permissions correctly. It's working.