-
Notifications
You must be signed in to change notification settings - Fork 12
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
MODULE_NOT_FOUND error after fresh socket-cli install #44
Comments
What version of $ node --version
$ npm --version |
|
Managed to solve this by installing an additional node and npm via nvm. Now everything runs, served from directories of my normal user. |
I wanted to try out the Socket CLI, but after following the safe-npm FAQ I'm receiving the same error listed in OP's initial comment. I tried Node.js v18 as well, but I still receive the same error. @bmeck Is it expected that the Socket CLI doesn't work with Node.js version managers? OP mentioned using nvm on Xubuntu; I'm currently using fnm on macOS, but the error is exactly the same. Here's my terminal output, with all commands being run from the $ sw_vers
ProductName: macOS
ProductVersion: 14.5
BuildVersion: 23F79
$ fnm --version && which fnm
fnm 1.37.1
/opt/homebrew/bin/fnm
$ node -v && which node
v20.14.0
/Users/dustin/.local/state/fnm_multishells/73652_1718675711857/bin/node
$ npm -v && which npm
10.7.0
/Users/dustin/.local/state/fnm_multishells/73652_1718675711857/bin/npm
$ npm install --global @socketsecurity/cli
added 161 packages in 4s
64 packages are looking for funding
run `npm fund` for details
$ socket --version
0.9.3
$ socket npm install --save-dev typescript
node:internal/modules/cjs/loader:1148
throw err;
^
Error: Cannot find module '/Users/dustin/Library/Application Support/fnm/node-versions/v20.14.0/installation/lib/node_modules/npm/node_modules/npmlog/lib/log.js'
Require stack:
- /Users/dustin/Library/Application Support/fnm/node-versions/v20.14.0/installation/lib/node_modules/@socketsecurity/cli/lib/shadow/npm-injection.cjs
- internal/preload
at Module._resolveFilename (node:internal/modules/cjs/loader:1145:15)
at Module._load (node:internal/modules/cjs/loader:986:27)
at Module.require (node:internal/modules/cjs/loader:1233:19)
at require (node:internal/modules/helpers:179:18)
at Object.<anonymous> (/Users/dustin/Library/Application Support/fnm/node-versions/v20.14.0/installation/lib/node_modules/@socketsecurity/cli/lib/shadow/npm-injection.cjs:271:16)
at Module._compile (node:internal/modules/cjs/loader:1358:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
at Module.load (node:internal/modules/cjs/loader:1208:32)
at Module._load (node:internal/modules/cjs/loader:1024:12)
at internalRequire (node:internal/modules/cjs/loader:176:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/dustin/Library/Application Support/fnm/node-versions/v20.14.0/installation/lib/node_modules/@socketsecurity/cli/lib/shadow/npm-injection.cjs',
'internal/preload'
]
}
Node.js v20.14.0 |
After installing socket-cli globally on a machine running Xubuntu, I get the following error:
I’m not a linux expert yet. I couldn’t figure out how to install npmlog into the
/usr/share
directory.The text was updated successfully, but these errors were encountered: