gpt4 book ai didi

node.js - Package.json 指定了 Node 版本,但 Azure 告诉我没有指定

转载 作者:搜寻专家 更新时间:2023-10-31 23:27:27 25 4
gpt4 key购买 nike

我正在尝试为我的 Azure 网站编写自定义部署脚本。我收到了一些我认为与使用旧版 Node.js 的 Azure 相关的错误。

我在网上找到的所有地方都说要在您的 package.json 中指定 Node 版本文件像这样:

"engines" : { "node" : "0.10.26" }

所以我把它放在我的 package.json 中文件,但在推送这些更改后,日志仍显示以下消息:
The package.json file does not specify node.js engine version constraints.
The node.js application will run with the default node.js version 0.10.5.

这里发生了什么?

我的 package.json文件:

{
"name": "app-kit",
"namespace": "appkit",
"APIMethod": "stub",
"proxyURL": "http://localhost:8000",
"proxyPath": "/api",
"version": "0.0.0",
"private": true,
"directories": {
"doc": "doc",
"test": "test"
},
"engines" : {"node" : "0.10.26"},
"scripts": {
"start": "grunt server",
"build": "grunt build:debug",
"test": "grunt test:ci"
},
"repository": {
"type": "git",
"url": "git://github.com/stefanpenner/ember-app-kit.git"
},
"author": "",
"license": "MIT",
"dependencies" : {
"express": "~3.4.8",
"lockfile": "~0.4.2",
"grunt": "~0.4.2",
"grunt-cli": "~0.1.9",
"load-grunt-config": "~0.7.0",
"grunt-contrib-copy": "~0.4.1",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-jshint": "~0.8.0",
"grunt-contrib-uglify": "~0.2.7",
"grunt-contrib-cssmin": "~0.6.2",
"grunt-preprocess": "~3.0.1",
"grunt-es6-module-transpiler": "~0.6.0",
"grunt-concat-sourcemap": "~0.4.0",
"grunt-concurrent": "~0.4.3",
"grunt-usemin": "~0.1.13",
"grunt-rev": "~0.1.0",
"grunt-ember-templates": "~0.4.18",
"originate": "~0.1.5",
"grunt-es6-import-validate": "0.0.6",
"grunt-contrib-less": "^0.11.0"
},
"devDependencies": {
"express": "~3.4.8",
"lockfile": "~0.4.2",
"bower": "~1.2.7",
"grunt": "~0.4.2",
"grunt-cli": "~0.1.9",
"load-grunt-config": "~0.7.0",
"grunt-contrib-watch": "~0.5.3",
"grunt-contrib-copy": "~0.4.1",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-jshint": "~0.8.0",
"grunt-contrib-uglify": "~0.2.7",
"grunt-contrib-cssmin": "~0.6.2",
"grunt-preprocess": "~3.0.1",
"grunt-es6-module-transpiler": "~0.6.0",
"grunt-concat-sourcemap": "~0.4.0",
"grunt-concurrent": "~0.4.3",
"grunt-usemin": "~0.1.13",
"grunt-rev": "~0.1.0",
"grunt-ember-templates": "~0.4.18",
"grunt-contrib-testem": "~0.5.14",
"express-namespace": "~0.1.1",
"request": "~2.33.0",
"loom-generators-ember-appkit": "~1.0.5",
"originate": "~0.1.5",
"loom": "~3.1.2",
"connect-livereload": "~0.3.1",
"grunt-es6-import-validate": "0.0.6",
"grunt-contrib-less": "^0.11.0",
"grunt-ftp-deploy": "^0.1.2"
}
}

我知道 devDependencies 和依赖项中有重复,这是不必要的。这是因为我想在 azure 上咕噜咕噜地构建我的应用程序,但是某些依赖项无法正确安装 b/c 的 C 头文件(或者看起来如此)。我试图在依赖项键中只包含构建应用程序 prod 版本所需的那些。如果我可以在 Azure 上使用它,我计划清理它。

最佳答案

我正在尝试使用 Node 的 iojs insetead 并且遇到了相同/类似的问题。

请删除启动脚本行并遵循自定义部署脚本,一切都会好起来的。您可以找到部署脚本 here用于运行 iojs。我认为它们可以适应运行任何 Node 版本。

我复制了普通 Node 项目中的所有文件(使用 bin/www 脚本),但它们不起作用。似乎我需要对该脚本进行一些更改或将其删除,否则,一切看起来都可以正常工作。

祝你好运,

关于node.js - Package.json 指定了 Node 版本,但 Azure 告诉我没有指定,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23437799/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com