api-designer icon indicating copy to clipboard operation
api-designer copied to clipboard

Error: Cannot find module 'request'

Open goodevilgenius opened this issue 7 years ago • 15 comments

A fresh install of api-designer results in the following:

$ npm install -g api-designer
npm WARN deprecated [email protected]: wrench.js is deprecated! You should check out fs-extra (https://github.com/jprichardson/node-fs-extra) for any operations you were using wrench for. Thanks for all the usage over the years.
/Users/danjones/.nvm/versions/node/v8.7.0/bin/api-designer -> /Users/danjones/.nvm/versions/node/v8.7.0/lib/node_modules/api-designer/bin/api-designer.js
+ [email protected]
added 145 packages in 7.83s

$ api-designer
module.js:529
    throw err;
    ^

Error: Cannot find module 'request'
    at Function.Module._resolveFilename (module.js:527:15)
    at Function.Module._load (module.js:476:23)
    at Module.require (module.js:568:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/danjones/.nvm/versions/node/v8.7.0/lib/node_modules/api-designer/bin/api-designer.js:6:15)
    at Module._compile (module.js:624:30)
    at Object.Module._extensions..js (module.js:635:10)
    at Module.load (module.js:545:32)
    at tryModuleLoad (module.js:508:12)
    at Function.Module._load (module.js:500:3)

After running npm install -g request, api-designer runs properly.

goodevilgenius avatar Nov 15 '17 15:11 goodevilgenius

I had the same issue with a fresh install of api-designer.

Thanks for the fix @goodevilgenius

pongz79 avatar Nov 22 '17 10:11 pongz79

I had the same issue too. thanks for solve my problem.

ch8771 avatar Nov 23 '17 06:11 ch8771

awesome, the same issue, now it works fine.

qileilove avatar Dec 08 '17 13:12 qileilove

+1

ssjunior avatar Jan 07 '18 00:01 ssjunior

npm -g install request

dark-neou avatar Feb 07 '18 09:02 dark-neou

2018 and the module is still broken. Latest node version (v9.8.0) and npm v 5.6.0. I don't want to install request globally. If you use a module, then you have to add it to the dependencies in the package.json. Surely this can't be that hard.

T-vK avatar Mar 29 '18 12:03 T-vK

@T-vK https://github.com/mulesoft/api-designer/blob/master/package.json#L22

It is listed. 🤷‍♂️

goodevilgenius avatar Mar 29 '18 13:03 goodevilgenius

See https://github.com/mulesoft/api-designer/issues/518#issuecomment-407605849

The version is old on npmjs.com. Latest is on master branch. Try the below command to install latest version.

npm install -g mulesoft/api-designer#master

shisama avatar Jul 25 '18 01:07 shisama

I had to follow npm install -g mulesoft/api-designer#master to get the designer to work. Recommend the install instructions on the readme page be updated

mp3monster avatar Nov 08 '18 08:11 mp3monster

npm install -g mulesoft/api-designer did the trick for me.

T-vK avatar Nov 08 '18 09:11 T-vK

Did not install well for me. There were six warnings from NPM about deprecated packages and a warning from api-designer about another deprecated package.

Is this project still being maintained?

MachineName:~ anguscs$ npm install -g mulesoft/api-designer#master npm WARN deprecated [email protected]: Use uuid module instead npm WARN deprecated [email protected]: This module moved to @hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues. npm WARN deprecated [email protected]: This module moved to @hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues. npm WARN deprecated [email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial). npm WARN deprecated [email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial). npm WARN deprecated [email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial). /usr/local/bin/api-designer -> /usr/local/lib/node_modules/api-designer/bin/api-designer.js + [email protected] added 149 packages from 158 contributors in 13.324s MachineName:~ anguscs$ api-designer API designer running on port 3000... (node:14599) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated

AngusCS avatar Jul 05 '19 06:07 AngusCS

@carowright I think this commit closes this issue. https://github.com/mulesoft/api-designer/commit/842b07fb0990ddff0d4c41210a9357d4295979d8#diff-b9cfc7f2cdf78a7f4b91a753d10865a2

tamiryspino avatar Oct 19 '19 03:10 tamiryspino

i had the same issue,

thanks for the solution @goodevilgenius

santileira avatar Oct 29 '19 15:10 santileira

nice~

Yovven avatar Sep 03 '20 03:09 Yovven

邮件收到啦~~谢谢你!

Yovven avatar Dec 22 '21 01:12 Yovven