Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Cannot find module 'algoliasearch' #302

Open
morariu opened this issue Dec 28, 2020 · 2 comments
Open

Error: Cannot find module 'algoliasearch' #302

morariu opened this issue Dec 28, 2020 · 2 comments

Comments

@morariu
Copy link

morariu commented Dec 28, 2020

Running the following command after installing algoliasearch and glob globally:

node ./themes/minimo/scripts/generate-search-index-algolia.js

Getting this error:

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

Error: Cannot find module 'algoliasearch'
Require stack:
- /home/laur/hugo/pijat/themes/minimo/scripts/generate-search-index-algolia.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
    at Function.Module._load (internal/modules/cjs/loader.js:864:27)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (/home/laur/hugo/pijat/themes/minimo/scripts/generate-search-index-algolia.js:3:23)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/laur/hugo/pijat/themes/minimo/scripts/generate-search-index-algolia.js'
  ]
}

@MunifTanjim
Copy link
Owner

How did you setup Node.js on your system? This error is happening because your Node.js installation couldn't resolve the globally installed algoliasearch package.

@morariu
Copy link
Author

morariu commented Jan 4, 2021

Thanks. Well, Node.js is installed globally. The Node version is v12.16.1 and the npm version is 6.14.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants