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 'proxy-from-env' #13

Closed
marcdumais-work opened this issue Jun 8, 2020 · 2 comments
Closed

Error: Cannot find module 'proxy-from-env' #13

marcdumais-work opened this issue Jun 8, 2020 · 2 comments

Comments

@marcdumais-work
Copy link

Hi,

With the newly released version of ripgrep I get an error upon install from npm:

Error: Cannot find module 'proxy-from-env'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/home/theia/node_modules/vscode-ripgrep/lib/download.js:11:24)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)

Looking at recent changes, I think I stumbled on the issue here: v1.5.8...v1.5.9#diff-3dac1e71569778416eb58de64427737eR11

An effectively runtime dependency was added (proxy-from-env), but as a dev-dependency. In consequence it's not present, when ripgrep's download script is called, unless a project happens to pull it for some other reason.

To reproduce:

$> mkdir /tmp/test; cd /tmp/test
$> npm init -y
$> npm install vscode-ripgrep --save-dep
> vscode-ripgrep@1.6.0 postinstall /tmp/a/node_modules/vscode-ripgrep
> node ./lib/postinstall.js

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

Error: Cannot find module 'proxy-from-env'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:690:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/tmp/a/node_modules/vscode-ripgrep/lib/download.js:11:24)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
npm WARN a@1.0.0 No description
npm WARN a@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vscode-ripgrep@1.6.0 postinstall: `node ./lib/postinstall.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the vscode-ripgrep@1.6.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

@roblourens
Copy link
Member

Sorry @EmmanuelGrandin, I forgot that this project has to be dependency-free. You could reimplement the functionality that those two modules provide. It's probably not too complex.

@marcdumais-work
Copy link
Author

Thanks @roblourens - 1.6.1 works for me.

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