错误:找不到模块“请求承诺”

ndh0cuux  于 2021-09-23  发布在  Java
关注(0)|答案(1)|浏览(294)

我正试图在雪花服务器中运行我的nodejs代码。代码还可以,但我得到了以下响应:

`Error:` Cannot find module 'request-promise'
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/server/auth/AuthController.js:10:10)
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)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)

我试图在stackoverflow和其他网站上研究类似的问题,并找到了以下解决方案:运行命令 npm install request-premise --save 这显示了以下输出:

npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/request-premise - Not found
npm ERR! 404 
npm ERR! 404  'request-premise@latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-07-27T12_45_13_757Z-debug.log

有人请帮忙吗

jk9hmnmh

jk9hmnmh1#

这是一个打字错误。应该是 npm install request-promise --save 而不是 npm install request-premise --save .
你写的 premise 用“e”而不是 promise 加上“o”。

相关问题