Hi, I'm trying to install the 'axios’, ‘ipware’ and ‘node-persist’ modules and I keep getting the error below (module not found). I had a similar issue with the ‘sendgrid’ module earlier, but that was fixed on your end. I also have the 'patreon' module installed and that seems to be loading correctly. Are we supposed to be able to load any npm module that we like, or are there some limitations? I’m using Parse Server v2.4.2, Node.js v7.10.1 and NPM v5.8.0. I’ve attached my package.json and package-lock.json files to this message.
Here is a link to my zipped node_modules folder, since the file appears to be too big to attach to this post (872 KB):
http://alexk.net/uploads/node_modules.zip
Thanks,
Alex
inVR
App1_test module.js:472
throw err;
^
Error: Cannot find module 'axios'
at Function.Module._resolveFilename (module.js:470:15)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/bundle/cloud/cloud_code/nats.js:25:15)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
I’m using Node.js v7.10.1 locally, same as I’m using on NodeChef. I’m also using npm v5.8.0, which came installed with Node v7.10.1. I tried updating npm to v6.0.0 and that version still had this same issue. I also tried the most recent version of ‘yarn’ instead of ’npm’ to install the packages and that didn’t fix anything either. Thanks for looking into this.
{"name":"test","description":"Parse Server cloud code modules","main":"main.js","dependencies":{"is-windows":"0.2.0","form-data":"2.3.2","jsprim":"1.4.1","mime":"1.6.0","sshpk":"1.14.1","sendgrid-rest":"2.4.0","uuid":"3.2.1","async.util.restparam":"0.5.2","unc-path-regex":"0.1.2","aws-sign2":"0.7.0","bottleneck":"1.16.0","asn1":"0.2.3","caseless":"0.12.0","oauth-sign":"0.8.2","assert-plus":"1.0.0","async.util.arrayeach":"0.5.2","qs":"6.5.2","sntp":"2.1.0","tunnel-agent":"0.6.0","combined-stream":"1.0.6","ms":"2.0.0","async.queue":"0.5.2","async.util.isarray":"0.5.2","minimist":"0.0.8","async.util.noop":"0.5.2","delayed-stream":"1.0.0","encoding":"0.1.12","is-unc-path":"0.1.2","json-schema-traverse":"0.3.1","sendgrid":"5.2.3","asynckit":"0.4.0","extend":"3.0.1","mimelib":"0.3.1","mkdirp":"0.5.1","fast-json-stable-stringify":"2.0.0","punycode":"1.4.1","har-schema":"2.0.0","isstream":"0.1.2","har-validator":"5.0.3","hawk":"6.0.2","stringstream":"0.0.5","cryptiles":"3.1.2","tweetnacl":"0.14.5","addressparser":"1.0.1","request":"2.85.0","bcrypt-pbkdf":"1.0.1","follow-redirects":"1.4.1","tough-cookie":"2.3.4","uue":"3.1.2","boom":"4.3.1","is-relative":"0.2.1","mailparser":"0.6.2","performance-now":"2.1.0","is-buffer":"1.1.6","json-schema":"0.2.3","mime-types":"2.1.18","extsprintf":"1.3.0","mime-db":"1.33.0","async.ensureasync":"0.5.2","async.util.onlyonce":"0.5.2","forever-agent":"0.6.1","safer-buffer":"2.1.2","is-typedarray":"1.0.0","node-persist":"3.0.0","hoek":"4.2.1","http-signature":"1.2.0","lodash.chunk":"4.2.0","async.util.ensureasync":"0.5.2","debug":"2.6.9","jsbn":"0.1.1","escape-string-regexp":"1.0.5","ecc-jsbn":"0.1.1","async.util.map":"0.5.2","async.util.queue":"0.5.2","is-absolute":"0.2.6","json-stringify-safe":"5.0.1","ajv":"5.5.2","co":"4.6.0","core-util-is":"1.0.2","iconv-lite":"0.4.23","async.util.setimmediate":"0.5.2","verror":"1.10.0","dashdash":"1.14.1","getpass":"0.1.7","fast-deep-equal":"1.1.0","axios":"0.18.0","aws4":"1.7.0","safe-buffer":"5.1.2"}}
Thanks for the reply. It turns out that I was using the legacy Java CLI, as I didn't realize that there was a new node.js CLI. Switching to the new node.js CLI fixed my issue and I’m now able to use the ‘axios’ and ‘node-persist’ node modules.
Since this issue was resolved, I tried removing the ‘request’ node module from my project (as I’m now using ‘axios’ instead), but after doing so and reinstalling the ‘sendgrid’ and ‘axios’ modules, I now get the following error when attempting to deploy my cloud code using the new CLI:
/usr/local/lib/node_modules/nodechef-cli/Commands/deploy.js:402
var files = fs.readdirSync(base_dir), dependencies = {}, has_module = false;
^
ReferenceError: base_dir is not defined
at DeployCloudCode (/usr/local/lib/node_modules/nodechef-cli/Commands/deploy.js:402:44)
at /usr/local/lib/node_modules/nodechef-cli/Commands/deploy.js:914:13
at Request._callback (/usr/local/lib/node_modules/nodechef-cli/remotecommon.js:53:13)
at Request.self.callback (/usr/local/lib/node_modules/nodechef-cli/node_modules/request/request.js:186:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:194:7)
at Request.<anonymous> (/usr/local/lib/node_modules/nodechef-cli/node_modules/request/request.js:1163:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:191:7)
at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/nodechef-cli/node_modules/request/request.js:1085:12)