簡體   English   中英

Node.js:嘗試要求使用Unirest模塊時找不到模塊錯誤

[英]Nodejs: Cannot find module error while trying to require unirest module

我在節點模塊之間有一個unirest客戶文件夾。

在嘗試要求獨占者時:

var uniClient = require('unirest');

出現以下錯誤:

module.js:472
throw err;
^

Error: Cannot find module 'unirest'

我也嘗試要求如下:

var uniClient = require('C:/node_modules/unirest');

但是我收到以下錯誤:

module.js:472
    throw err;
    ^

Error: Cannot find module 'C:/workspace/postman/webServices/target/node_modules/unirest'

我已經檢查過,並將Unirest客戶端的index.js放在C:/ workspace / postman / webServices / target / node_modules / unirest中。

我需要知道-或者,需要unirest客戶端的標准路徑是什么(請不要建議我已經安裝了軟件包,但是在這種情況下,我需要采購該文件夾)

  • 或者,在unirest目錄中查找哪個模塊,以便我可以找到需要相同路徑的路徑。

根據文檔,該節點正在嘗試執行以下操作: require

您應該在全局安裝此npm模塊。

npm install unirest -g

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM