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

v2.9.1: Cannot find module 'colors' #290

Open
EvilJordan opened this issue Feb 9, 2022 · 3 comments
Open

v2.9.1: Cannot find module 'colors' #290

EvilJordan opened this issue Feb 9, 2022 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@EvilJordan
Copy link
Contributor

After successful install via: npm install -g:

[12:51:31] eviljordan@shruggy ../dev/sfra/sfcc-ci $ sfcc-ci -V
node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module 'colors'
Require stack:
- /Users/eviljordan/dev/sfra/sfcc-ci/cli.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/Users/eviljordan/dev/sfra/sfcc-ci/cli.js:8:14)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/Users/eviljordan/dev/sfra/sfcc-ci/cli.js' ]
}
@tobiaslohr
Copy link
Contributor

hi @EvilJordan , tried to reproduce this:

$ git clone git@github.com:SalesforceCommerceCloud/sfcc-ci.git issue-290
$ cd issue-290
$ npm install -g
added 223 packages from 196 contributors in 6.79s
$ sfcc-ci -V
2.9.1

which succeeds here. Any detailed info you share to reproduce this?

@EvilJordan
Copy link
Contributor Author

Hmmm, I am now getting respectable build results by doing the following:

$ git clone git@github.com:SalesforceCommerceCloud/sfcc-ci.git
$ cd sfcc-ci
$ sudo npm install # this appears to be necessary so snyk can run

However, which sfcc-ci is pointing to /opt/local/bin/sfcc-ci, which in turn is a symlink to: sfcc-ci@ -> ../lib/node_modules/sfcc-ci/cli.js which in turn is: sfcc-ci@ -> ../../../../Users/eviljordan/dev/sfra/sfcc-ci (the directory where everything was just built).

Running sfcc-ci -V outputs 2.7.2, and I'm not sure why...

@tobiaslohr tobiaslohr added the help wanted Extra attention is needed label Feb 15, 2022
@tobiaslohr
Copy link
Contributor

@EvilJordan thanks! That seems to explain, why the error is thrown as it's using an older CLI version. Were you able to check, why it is using the older version although you just cloned from the repo using the default branch master? You can double check, by cd into the directory you just cloned into and then run

$ ./cli.js -V

If which sfcc-ci is pointing to an older version, you can also try running npm link in the fresh clone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants