我正在尝试通过npm start甚至简单的func start在本地运行我的azure函数。
直到今天以下错误开始出现时,它一直运行良好:
func.deps.json文件在此处:C:\ Program Files \ Microsoft \ Azure Functions Core Tools,并且具有以下依赖关系。
我什至不使用它,也不知道它是什么“错误:找不到在应用程序依赖项清单(func.deps.json)中指定的程序集:程序包:'Marklio.Metadata',版本: '1.2.20-beta'路径:'lib / netstandard2.0 / Marklio.Metadata.dll'npm“
xxx-api@0.0.1 build:docs C:\Code\xxxx-api
> tsc --sourcemap --lib es2017 src/_doc/index.ts --outDir doc && node doc/index.js
错误:
An assembly specified in the application dependencies manifest (func.deps.json) was not found:
package: 'Marklio.Metadata', version: '1.2.20-beta'
path: 'lib/netstandard2.0/Marklio.Metadata.dll'
npm ERR! code ELIFECYCLE
npm ERR! errno 2147516556
npm ERR! xxxx-api@0.0.1 install:extensions: `npm run build && cross-var func extensions install --prefix
$npm_package_config_azureFunctions_outDir`
npm ERR! Exit status 2147516556
npm ERR!
npm ERR! Failed at the xxx-api@0.0.1 install:extensions 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! C:\Users\user\AppData\Roaming\npm-cache\_logs\2020-08-13T04_37_33_194Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2147516556
npm ERR! panthera-api@0.0.1 install:extensions: `npm run build && cross-var func extensions install --prefix
$npm_package_config_azureFunctions_outDir`
npm ERR! Exit status 2147516556
npm ERR!
npm ERR! Failed at the xx-api@0.0.1 install:extensions 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! C:\Users\xx\AppData\Roaming\npm-cache\_logs\2020-08-13T04_37_33_194Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2147516556
npm ERR! xx-api@0.0.1 prestart: `npm run install:extensions`
npm ERR! Exit status 2147516556
npm ERR!
npm ERR! Failed at the xxx-api@0.0.1 prestart 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! C:\Users\xx\AppData\Roaming\npm-cache\_logs\2020-08-13T04_37_33_241Z-debug.log
我的package.json文件脚本如下:
"scripts": {
"build": "npm run clean && tsc && npm run build:configFiles && npm run build:docs",
"build:production": "npm run prestart && cross-var rimraf $npm_package_config_azureFunctions_outDir/local.*.json && cross-var copyfiles package.json $npm_package_config_azureFunctions_outDir && cd dist && npm install --production",
"build:configFiles": "cross-var copyfiles -u 1 \"$npm_package_config_azureFunctions_rootDir/**/*.json\" $npm_package_config_azureFunctions_outDir",
"build:docs": "tsc --sourcemap --lib es2017 src/_doc/index.ts --outDir doc && node doc/index.js",
"prestart": "npm run install:extensions",
"start": "npm-run-all -p start:host watch watch:config",
"start:doc": "npm run install:extensions && npm run start:host",
"start:host": "cross-var func host start --prefix $npm_package_config_azureFunctions_outDir",
"watch": "tsc --w",
"watch:config": "cross-var onchange \"$npm_package_config_azureFunctions_rootDir/**/*.json\" -- npm run build:configFiles",
"clean": "cross-var rimraf $npm_package_config_azureFunctions_outDir",
"install:extensions": "npm run build && cross-var func extensions install --prefix $npm_package_config_azureFunctions_outDir",
"install:extensions:force": "npm run build && cross-var func extensions install --prefix $npm_package_config_azureFunctions_outDir --force",
"test": "jest",
"precommit-msg": "echo 'Pre-commit checks...' && exit 0",
"fix": "eslint --ext .ts --fix ",
"fix-dry-run": "eslint --ext .ts --fix-dry-run",
"lint": "eslint . --ext .ts"
},
最后,上面提到的日志文件的内容:
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'install:extensions'
1 verbose cli ]
2 info using npm@6.14.5
3 info using node@v12.18.1
4 verbose run-script [
4 verbose run-script 'preinstall:extensions',
4 verbose run-script 'install:extensions',
4 verbose run-script 'postinstall:extensions'
4 verbose run-script ]
5 info lifecycle xxx-api@0.0.1~preinstall:extensions: xxx-api@0.0.1
6 info lifecycle xxx-api@0.0.1~install:extensions: xxx-api@0.0.1
7 verbose lifecycle xxx-api@0.0.1~install:extensions: unsafe-perm in lifecycle true
8 verbose lifecycle xxx-api@0.0.1~install:extensions: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Code\xxxAPI\xxx-api\node_modules\.bin;C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Code\xxxAPI\xxx-api\node_modules\.bin;C:\Users\xxx Sharma.STATEMERCANTILE\AppData\Roaming\npm;C:\Program Files\Common Files\Microsoft Shared\Microsoft Online Services;C:\Program Files (x86)\Common Files\Microsoft Shared\Microsoft Online Services;C:\Program Files\Microsoft MPI\Bin\;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\Seq\;C:\Program Files\Seq\Client\;C:\Program Files\dotnet\;C:\Program Files\nodejs\;C:\Program Files\Microsoft\Azure Functions Core Tools\;C:\Program Files (x86)\GitExtensions\;C:\Program Files (x86)\dotnet\;C:\Users\xxx Sharma.STATEMERCANTILE\AppData\Roaming\npm;C:\Users\xxx Sharma.STATEMERCANTILE\AppData\Local\Microsoft\WindowsApps;C:\Users\xxx Sharma.STATEMERCANTILE\.dotnet\tools;C:\Users\xxx Sharma.STATEMERCANTILE\AppData\Local\Programs\Microsoft VS Code\bin;
9 verbose lifecycle xxx-api@0.0.1~install:extensions: CWD: C:\Code\xxxAPI\xxx-api
10 silly lifecycle xxx-api@0.0.1~install:extensions: Args: [
10 silly lifecycle '/d /s /c',
10 silly lifecycle 'npm run build && cross-var func extensions install --prefix $npm_package_config_azureFunctions_outDir'
10 silly lifecycle ]
11 silly lifecycle xxx-api@0.0.1~install:extensions: Returned: code: 2147516556 signal: null
12 info lifecycle xxx-api@0.0.1~install:extensions: Failed to exec install:extensions script
13 verbose stack Error: xxx-api@0.0.1 install:extensions: `npm run build && cross-var func extensions install --prefix $npm_package_config_azureFunctions_outDir`
13 verbose stack Exit status 2147516556
13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:315:20)
13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:315:20)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid xxx-api@0.0.1
15 verbose cwd C:\Code\xxxAPI\xxx-api
16 verbose Windows_NT 10.0.18363
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "install:extensions"
18 verbose node v12.18.1
19 verbose npm v6.14.5
20 error code ELIFECYCLE
21 error errno 2147516556
22 error xxx-api@0.0.1 install:extensions: `npm run build && cross-var func extensions install --prefix $npm_package_config_azureFunctions_outDir`
22 error Exit status 2147516556
23 error Failed at the xxx-api@0.0.1 install:extensions script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2147516556, true ]
答案 0 :(得分:1)
好,我修复了它。从func.deps.json中删除此Marklio依赖项的所有引用,然后运行以下命令:npm i -g azure-functions-core-tools @ 3 --unsafe-perm true