[X] npm正在崩溃。
出了什么问题?npm install firebase-admin --save
CLI团队如何重现问题?npm install firebase-admin --save
npm -v打印:4.6.1 node -v prints:v6.10.3 npm config获取注册表打印:https://registry.npmjs.org/ Windows,OS X / macOS或Linux?:macOS
错误:
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:
{
"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"
}
}
答案 0 :(得分:1)
我使用npm install -g npm
升级了npm,错误消失了。
答案 1 :(得分:0)
我认为问题是你重命名了项目目录中的一些文件。根据你得到的错误,这可能是个问题。希望这可以帮助! :)
答案 2 :(得分:0)
在〜/ .npmrc中验证密钥_auth是否存在