简体   繁体   English

执行 npm 启动时 Azure 功能节点错误

[英]Azure functions node error when doing npm start

I am trying to run my azure functions locally by doing npm start or even the simple func start.我正在尝试通过执行 npm 启动甚至简单的 func 启动来在本地运行我的 azure 函数。

It was working perfectly until today when the following error started coming:直到今天开始出现以下错误时,它一直运行良好:

The func.deps.json file is here: C:\Program Files\Microsoft\Azure Functions Core Tools and it has the dependency below. func.deps.json 文件在这里:C:\Program Files\Microsoft\Azure Functions Core Tools,它具有以下依赖项。

I don't even use this and don't know what it is "Error: 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 "我什至不使用它,也不知道它是什么“错误:找不到应用程序依赖项清单(func.deps.json)中指定的程序集:package:'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

Error:错误:

  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

My package.json file scripts are as follows:我的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"
    },

Finally, the contents of the log file mentioned above:最后是上面提到的日志文件的内容:

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 ]

Remove all references of this Marklio dependency from the func.deps.json and run this: npm i -g azure-functions-core-tools@3 --unsafe-perm truefunc.deps.json中删除此 Marklio 依赖项的所有引用并运行: npm i -g azure-functions-core-tools@3 --unsafe-perm true

I found that if you go to the path specified after the error message, and delete the Releases folder and run Visual Studio, it will redownload everything you need and it will run fine.我发现如果你 go 到错误消息后指定的路径,并删除 Releases 文件夹并运行 Visual Studio,它会重新下载你需要的所有东西,它会运行良好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM