WebThingsIO/webthing-node

Fail to find "webthing" Node module

Closed this issue · 1 comments

n-jay commented

Hi all,
After I installed the webthing module via npm as instructued, I tried to run the command node single-thing.js. This is when I was confronted with the following error:

internal/modules/cjs/loader.js:583
    throw err;
    ^

Error: Cannot find module 'webthing'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/media/nuwan/7528bf5e-4c32-448c-8c6c-0c40f3d39dc0/nuwan/Desktop/Projects/personal/mozilla-web-things/webthing-node/example/multiple-things.js:9:5)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)

Believing it was a problem with the module not being installed properly I did a search and confirmed that it had indeed installed globally.

nuwan@nuwan-Aspire-E5-573G:~$ npm search webthing
NAME                      | DESCRIPTION          | AUTHOR          | DATE       | VERSION  | KEYWORDS                      
webthing                  | HTTP Web Thing…      | =mozilla-iot    | 2018-10-12 | 0.8.3    | mozilla iot web thing webthing

After deleting the local node_modules folder within the webthing-node directory I did a npm install but still the issue persists.
Although when searched I could not find a webthing module inside the local node_modules directory.

Running Ubuntu 18.04 on Node v10.6.0 installed via nvm

n-jay commented

Rectified issue.
The issue was fixed upon creating a new node project with required Thing creation code.