简体   繁体   English

节点模块无法导入

[英]Node module is not able to import

I'm using nodejs third party module in my project. 我在项目中使用nodejs第三方模块。 I followed the document given in NPM site. 我遵循了NPM网站中给出的文档。 But when i execute js script using node,its showing error node module not found. 但是当我使用node执行js脚本时,显示错误节点模块未找到。

  • My node-module tableau-api My code : 我的节点模块tableau-api我的代码:
  • lambda function for alexa skill Lambda函数用于Alexa技能

     'use strict'; const Alexa = require("alexa-sdk"); var tab = require("tableau-api"); exports.handler = function(event, context, callback) { const alexa = Alexa.handler(event, context); alexa.registerHandlers(handlers); alexa.execute(); }; const handlers = { 'LaunchRequest': function() { this.emit('SayHello'); }, 'HelloWorldIntent': function() { this.emit('SayHello'); } }; 

Error: 错误:

"errorMessage": "Cannot find module 'tableau-api'",
  "errorType": "Error",
  "stackTrace": [
    "Function.Module._load (module.js:474:25)",
    "Module.require (module.js:596:17)",
    "require (internal/module.js:11:18)",
    "Object.<anonymous> (/var/task/index.js:3:11)",
    "Module._compile (module.js:652:30)",
    "Object.Module._extensions..js (module.js:663:10)",
    "Module.load (module.js:565:32)",
    "tryModuleLoad (module.js:505:12)",
    "Function.Module._load (module.js:497:3)"

It could be that you have not installed the package. 可能是您尚未安装该软件包。

Try npm install --save tableau-api 尝试npm install --save tableau-api

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM