简体   繁体   English

npm install firebase-admin --save失败,出现ENOENT

[英]npm install firebase-admin --save fails with ENOENT

I'm opening this issue because: 我打开这个问题是因为:

[ X ] npm is crashing. [X] npm崩溃。

What's going wrong? 怎么了

npm install firebase-admin --save npm install firebase-admin-保存

How can the CLI team reproduce the problem? CLI团队如何重现该问题?

npm install firebase-admin --save npm install firebase-admin-保存

supporting information: 支持信息:

npm -v prints: 4.6.1 node -v prints: v6.10.3 npm config get registry prints: https://registry.npmjs.org/ Windows, OS X/macOS, or Linux?: macOS npm -v打印:4.6.1节点-v打印:v6.10.3 npm config获取注册表打印: https ://registry.npmjs.org/ Windows,OS X / macOS或Linux?:macOS

Error: 错误:

 npm WARN aws-serverless-express-example@2.1.1 No repository field. npm ERR! path /Users/hg/Downloads/backend/node_modules/.staging/grpc-727babf9/node_modules/minimist npm ERR! code ENOENT npm ERR! errno -2 npm ERR! syscall rename npm ERR! enoent ENOENT: no such file or directory, rename '/Users/hg/Downloads/backend/node_modules/.staging/grpc-727babf9/node_modules/minimist' -> '/Users/hg/Downloads/backend/node_modules/.staging/minimist-64caaba7' npm ERR! enoent This is most likely not a problem with npm itself npm ERR! enoent and is related to npm not being able to find a file. npm ERR! enoent npm ERR! A complete log of this run can be found in: npm ERR! /Users/hg/.npm/_logs/2017-10-21T00_29_19_812Z-debug.log 

package.json: 的package.json:

 { "name": "aws-serverless-express-example", "version": "2.1.1", "description": "Example application for running a Node Express app on AWS Lambda using Amazon API Gateway.", "main": "lambda.js", "config": { }, "scripts": { "start": "node app.local.js", "config": "node ./scripts/configure.js", "deconfig": "node ./scripts/deconfigure.js", "local": "node scripts/local", "invoke-lambda": "aws lambda invoke --function-name $npm_package_config_functionName --region $npm_package_config_region --payload file://api-gateway-event.json lambda-invoke-response.json && cat lambda-invoke-response.json", "create-bucket": "aws s3 mb s3://$npm_package_config_s3BucketName --region $npm_package_config_region", "delete-bucket": "aws s3 rb s3://$npm_package_config_s3BucketName --region $npm_package_config_region", "package": "aws cloudformation package --template ./cloudformation.yaml --s3-bucket $npm_package_config_s3BucketName --output-template packaged-sam.yaml --region $npm_package_config_region", "deploy": "aws cloudformation deploy --template-file packaged-sam.yaml --stack-name $npm_package_config_cloudFormationStackName --capabilities CAPABILITY_IAM --region $npm_package_config_region", "package-deploy": "npm run package && npm run deploy", "delete-stack": "aws cloudformation delete-stack --stack-name $npm_package_config_cloudFormationStackName --region $npm_package_config_region", "setup": "npm install && (aws s3api get-bucket-location --bucket $npm_package_config_s3BucketName --region $npm_package_config_region || npm run create-bucket) && npm run package-deploy", "test": "echo $npm_package_config_s3BucketName; echo $npm_package_config_region;", "test2": "echo $npm_package_config_s3BucketName; echo $npm_package_config_region;", "win-config": "npm run config", "win-deconfig": "npm run deconfig", "win-local": "npm run local", "win-invoke-lambda": "aws lambda invoke --function-name %npm_package_config_functionName% --region %npm_package_config_region% --payload file://api-gateway-event.json lambda-invoke-response.json && cat lambda-invoke-response.json", "win-create-bucket": "aws s3 mb s3://%npm_package_config_s3BucketName% --region %npm_package_config_region%", "win-delete-bucket": "aws s3 rb s3://%npm_package_config_s3BucketName% --region %npm_package_config_region%", "win-package": "aws cloudformation package --template ./cloudformation.yaml --s3-bucket %npm_package_config_s3BucketName% --output-template packaged-sam.yaml --region %npm_package_config_region%", "win-deploy": "aws cloudformation deploy --template-file packaged-sam.yaml --stack-name %npm_package_config_cloudFormationStackName% --capabilities CAPABILITY_IAM --region %npm_package_config_region%", "win-package-deploy": "npm run win-package && npm run win-deploy", "win-delete-stack": "aws cloudformation delete-stack --stack-name %npm_package_config_cloudFormationStackName% --region %npm_package_config_region%", "win-setup": "npm install && (aws s3api get-bucket-location --bucket %npm_package_config_s3BucketName% --region %npm_package_config_region% || npm run win-create-bucket) && npm run win-package-deploy" }, "license": "Apache-2.0", "dependencies": { "aws-sdk": "^2.4.1", "aws-serverless-express": "^3.0.0", "body-parser": "^1.17.1", "compression": "^1.6.2", "connect-ensure-login": "^0.1.1", "cors": "^2.8.3", "express": "^4.15.2", "express-session": "^1.11.3", "firebase-admin": "^5.4.2", "jsonwebtoken": "^8.0.1", "jssha": "^2.3.1", "morgan": "^1.6.1", "passport": "^0.2.2", "passport-jwt": "^3.0.0", "pug": "^2.0.0-rc.1", "uuid": "^3.1.0" } } 

我使用npm install -g npm升级了npm,错误消失了。

I think the issue is that you renamed some files in your projects directory. 我认为问题在于您在项目目录中重命名了一些文件。 That's probably the issue according to the error you got. 根据您得到的错误,这可能是问题所在。 Hope this helps! 希望这可以帮助! :) :)

在〜/ .npmrc中验证密钥_auth是否存在

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

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