2017-06-18 52 views
0

我在Azure中创建一个Web应用程序。@ line/bot-sdk in azure not working

并从存储库中的bitbucket中进行部署。

但蔚蓝总是给我这个错误

Error: Cannot find module '@line/bot-sdk' 

的package.json:

{ 
 
    "name": "linebot", 
 
    "version": "1.0.0", 
 
    "description": "", 
 
    "main": "index.js", 
 
    "dependencies": { 
 
    "@line/bot-sdk": "^2.0.0", 
 
    "body-parser": "^1.17.2", 
 
    "express": "^4.15.3", 
 
    "fs-extra": "^3.0.1" 
 
    }, 
 
    "devDependencies": {}, 
 
    "engines": { 
 
    "node": ">=6" 
 
    }, 
 
    "scripts": { 
 
    "start": "node index.js" 
 
    }, 
 
    "author": "", 
 
    "license": "ISC" 
 
}

回答

0

它看起来像 “@线/ BOT-SDK” 尚未安装正常。首先,请确保package.josn位于存储库的根文件夹中。

enter image description here

一旦你把你的代码到位桶,将库同步到/site/wwwroot Azure上的应用服务,在这里通过执行部署脚本运行npm install --production

:: 3. Install npm packages 
IF EXIST "%DEPLOYMENT_TARGET%\package.json" (
    pushd "%DEPLOYMENT_TARGET%" 
    call :ExecuteCmd !NPM_CMD! install --production 
    IF !ERRORLEVEL! NEQ 0 goto error 
    popd 
) 

最后,你可能要检查的依赖他们是否已经通过应用服务编辑https://[YouAppName].scm.azurewebsites.net/dev/wwwroot/)已安装。

enter image description here

+0

我输入'LS node_modules'在蔚蓝的控制台窗口,我不能在里面找“@line”文件夹中。但它确实存在于BitBucker回购中。 –