api-designer
api-designer copied to clipboard
Error: Cannot find module 'request'
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.
I had the same issue with a fresh install of api-designer.
Thanks for the fix @goodevilgenius
I had the same issue too. thanks for solve my problem.
awesome, the same issue, now it works fine.
+1
npm -g install request
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 https://github.com/mulesoft/api-designer/blob/master/package.json#L22
It is listed. 🤷♂️
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
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
npm install -g mulesoft/api-designer
did the trick for me.
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
@carowright I think this commit closes this issue. https://github.com/mulesoft/api-designer/commit/842b07fb0990ddff0d4c41210a9357d4295979d8#diff-b9cfc7f2cdf78a7f4b91a753d10865a2
i had the same issue,
thanks for the solution @goodevilgenius
nice~
邮件收到啦~~谢谢你!