【问题标题】:Deployment fails while installing node-sass on Azure linux web app在 Azure linux Web 应用上安装 node-sass 时部署失败
【发布时间】:2019-02-07 18:25:08
【问题描述】:

我正在尝试将网站部署到运行 Linux 的 Azure 应用服务,但部署失败。问题似乎在于安装 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

【问题讨论】:

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


    【解决方案1】:

    我关注了这个guide。在搭建 express 应用程序后,我将代码推送到 github repo 并使用 VS Code 中的 Azure Extensions 将部署源配置到我最近创建的 github repo 并成功。

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

    【讨论】:

      猜你喜欢
      • 2017-10-14
      • 1970-01-01
      • 2015-07-19
      • 2020-02-25
      • 2020-08-23
      • 2022-06-14
      • 1970-01-01
      • 1970-01-01
      • 2021-02-17
      相关资源
      最近更新 更多