我正在尝试在 Snowflake Server 中运行我的 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
请大家帮忙
答案 0 :(得分:0)
这是一个拼写错误。应该是 npm install request-promise --save
而不是 npm install request-premise --save
。
你用“e”写了premise
而不是用“o”写了promise
。