在Azure Linux Web应用程序上安装Node-Sass时部署失败

时间:2019-02-07 18:25:09

标签: azure azure-web-app-service node-sass fsevents

我正在尝试将网站部署到运行Linux的Azure App Service,但是部署失败。问题似乎与安装node-sass有关。

我已将Node设置为服务支持的最新版本。

> node-sass@4.11.0 install /home/site/wwwroot/node_modules/node-sass
> node scripts/install.js

fs.js:126
    throw err;
    ^

Error: EINVAL: invalid argument, open '/home/site/wwwroot/node_modules/node-sass/package.json'
    at Object.fs.openSync (fs.js:559:3)
    at Object.fs.readFileSync (fs.js:465:33)
    at Object.Module._extensions..json (internal/modules/cjs/loader.js:695:20)
    at Module.load (internal/modules/cjs/loader.js:589:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
    at Function.Module._load (internal/modules/cjs/loader.js:520:3)
    at Module.require (internal/modules/cjs/loader.js:626:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/home/site/wwwroot/node_modules/node-sass/lib/extensions.js:7:9)
    at Module._compile (internal/modules/cjs/loader.js:678:30)



    npm WARN ppi-web@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.11.0 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-sass@4.11.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
...
npm ERR! A complete log of this run can be found in:
npm ERR!     /home/.npm/_logs/2019-02-07T18_09_48_891Z-debug.log
Running "/opt/nodejs/10.1.0/bin/node" "/opt/npm/6.0.1/node_modules/npm/bin/npm-cli.js" run-script build

1 个答案:

答案 0 :(得分:0)

我遵循了这个guide。在搭建快速应用程序之后,我将代码推送到github存储库,并使用VS Code中的Azure扩展将部署源配置为我最近创建的github存储库并成功。

VS Code Azure Deployment

我不确定您如何部署,但希望这会有所帮助。不幸的是,我没有足够的声誉点来询问您如何进行部署,但是请随时告诉我。