plewin / tp-link-modem-router

Goodies for TP-Link modem routers
GNU General Public License v3.0
82 stars 17 forks source link

module error #10

Closed abalzi closed 3 years ago

abalzi commented 3 years ago

Hi

I'm not an expert on nodejs and yarn, but I tried to solve by myself some issue. I'm tring to run it on Raspberry Pi 4 with Ubuntu 21.04 64bit. I've also installed the pkgs

Setting up node-arrify (2.0.1-1) ... Setting up node-is-buffer (2.0.5-1) ... Setting up node-is-plain-obj (3.0.0-1) ... Setting up node-kind-of (6.0.3+dfsg-1) ... Setting up node-minimist (1.2.5+~cs5.3.1-2)

When I try to run your scripts I receive the below errors, what I missing?

**internal/process/esm_loader.js:74 internalBinding('errors').triggerUncaughtException( ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'minimist' imported from /usr/local/sms/tp-link-modem-router/sms-send.js Did you mean to import minimist/index.js? at packageResolve (internal/modules/esm/resolve.js:650:9) at moduleResolve (internal/modules/esm/resolve.js:691:18) at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:784:11) at Loader.resolve (internal/modules/esm/loader.js:100:40) at Loader.getModuleJob (internal/modules/esm/loader.js:246:28) at ModuleWrap. (internal/modules/esm/module_job.js:47:40) at link (internal/modules/esm/module_job.js:46:36) { code: 'ERR_MODULE_NOT_FOUND' }**

plewin commented 3 years ago

Hey @abalzi

It looks like a dependency was not installed correctly.

Did the yarn install command succeed ? If not, can you provide its ouput ?

abalzi commented 3 years ago

Hi plewin

sorry for delay in the answer, due my vacation. Below the output of yarn command:

root@bersaglio:/usr/local/sms/tp-link-modem-router# yarn install yarn install v1.22.5 [1/4] Resolving packages... [2/4] Fetching packages... [3/4] Linking dependencies... [4/4] Building fresh packages... Done in 20.10s.

abalzi commented 3 years ago

Hi

I solved, you can close the issue. I put the commands in a simple bash script below and it works. Thanks for support

p.s.: If you want update the supported models, I work with MR200: Firmware Version:‪1.2.0 0.9.1 v0001.0 Build 210120 Rel.67320n Hardware Version:‪Archer MR200 v5 00000001

#!/bin/sh

#Process arguments
if [ $# -gt 1 ] ; then
  phone="$1"
  msg="$2"
fi
cd /usr/local/sms/tp-link-modem-router/
./sms-send.js --url="http://192.168.1.1" --login="admin" --password="password" "$phone" "$msg"
plewin commented 3 years ago

Hi @abalzi thanks a lot for the supported model report ! Best regards,