Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm run install-all fails, then just plain old npm install fails #5

Open
julian45 opened this issue May 7, 2016 · 24 comments
Open

Comments

@julian45
Copy link

julian45 commented May 7, 2016

sudo npm run install-all gives:

npm ERR! Linux 3.13.0-74-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "install-all"
npm ERR! node v6.1.0
npm ERR! npm  v3.8.6
npm ERR! code ELIFECYCLE
npm ERR! @jimpick/[email protected] install-all: `npm install && cd packages/frontend && npm install`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @jimpick/[email protected] install-all script 'npm install && cd packages/frontend && npm install'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the @jimpick/lambda-comments package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm install && cd packages/frontend && npm install
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs @jimpick/lambda-comments
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls @jimpick/lambda-comments
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! Please include the following file with any support request:
npm ERR!     /home/ubuntu/lambda-comments/npm-debug.log

sudo npm install on its own gives:

npm ERR! Linux 3.13.0-74-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v6.1.0
npm ERR! npm  v3.8.6                                                                      npm ERR! code E404

npm ERR! 404 Not found : @jimpick/akismet-api
npm ERR! 404                                                                              npm ERR! 404  '@jimpick/akismet-api' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of '@jimpick/lambda-comments'               npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/ubuntu/lambda-comments/npm-debug.log

Something tells me that this may have to do with the recent security upgrade to 6.x and the apparent phasing-out of 5.x.

@julian45
Copy link
Author

julian45 commented May 7, 2016

Also, your README specifies some stuff with Lambda and 4.3 - due to current needs, I can't downgrade to 4.x.

@jimpick
Copy link
Owner

jimpick commented May 7, 2016

Looks like it's failing on the scoped package I published: @jimpick/akismet-api

Funny, I tried an 'npm install' here, and I didn't get that error.

It had a workaround for some webpack issues I encountered. If I fix issue #3, I won't need the scoped package.

@jimpick
Copy link
Owner

jimpick commented May 7, 2016

Node 4.3 is the version that it runs on inside Amazon's cloud. I've been developing with a newer version with no problem.

@julian45
Copy link
Author

julian45 commented May 7, 2016

Huh. That's interesting; Lemme try grabbing nvm and seeing if I can (for some inexplicable reason) install from 4.x.

@julian45
Copy link
Author

julian45 commented May 7, 2016

Nope, still fails. Should I try reinstalling when #3 is fixed?

@jimpick
Copy link
Owner

jimpick commented May 10, 2016

I've upgraded akismet-api so there's no need for the scoped package anymore. Can you try again to see if that makes your problem go away?

@julian45
Copy link
Author

julian45 commented May 10, 2016

Seems to go fine now! However, I get warned with the following:

npm WARN deprecated [email protected]: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.

As a safety, I ran sudo npm install pug. It also said something related to fsevents being incompatible, but due to the fact that I'm doing this on a Linux machine, that always happens.

@chrisfosterelli
Copy link

@tcby45 mocha uses those two dependencies. They won't upgrade them yet, as it breaks Node 0.8 support. See here and here if you want to add your voice. The next release of Mocha will have those fixed.

In the meantime though, those warnings won't cause any problems. You can use npm install --production which won't produce those warnings.

@julian45
Copy link
Author

Alright. On another note, sudo npm run flip-lambdas-to-4.3 fails, producing the following output:

> @jimpick/lambda-comments@0.0.1 flip-lambdas-to-4.3 /home/ubuntu/lambda-comment              s
> babel-node bin/flip-lambdas-to-4.3.js

Updating function QueueCommentLambdaFunction to Node 4.3
TypeError: Cannot read property 'PhysicalResourceId' of undefined
    at _callee$ (flip-lambdas-to-4.3.js:30:24)
    at tryCatch (/home/ubuntu/lambda-comments/node_modules/babel-regenerator-run              time/runtime.js:61:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/home/ubuntu/lambda-comme              nts/node_modules/babel-regenerator-runtime/runtime.js:329:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/hom              e/ubuntu/lambda-comments/node_modules/babel-regenerator-runtime/runtime.js:94:21              )
    at step (flip-lambdas-to-4.3.js:2:1)
    at flip-lambdas-to-4.3.js:2:1
    at new Promise (/home/ubuntu/lambda-comments/node_modules/core-js/modules/es              6.promise.js:193:7)
    at flip-lambdas-to-4.3.js:2:1
    at run (/home/ubuntu/lambda-comments/bin/flip-lambdas-to-4.3.js:93:16)
    at Object.<anonymous> (flip-lambdas-to-4.3.js:41:1)
TypeError: Cannot read property 'PhysicalResourceId' of undefined
    at _callee$ (flip-lambdas-to-4.3.js:30:24)
    at tryCatch (/home/ubuntu/lambda-comments/node_modules/babel-regenerator-run              time/runtime.js:61:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/home/ubuntu/lambda-comme             nts/node_modules/babel-regenerator-runtime/runtime.js:329:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/hom              e/ubuntu/lambda-comments/node_modules/babel-regenerator-runtime/runtime.js:94:21)
    at step (flip-lambdas-to-4.3.js:2:1)
    at flip-lambdas-to-4.3.js:2:1
    at new Promise (/home/ubuntu/lambda-comments/node_modules/core-js/modules/es               6.promise.js:193:7)
    at flip-lambdas-to-4.3.js:2:1
    at run (/home/ubuntu/lambda-comments/bin/flip-lambdas-to-4.3.js:93:16)
    at Object.<anonymous> (flip-lambdas-to-4.3.js:41:1)

npm ERR! Linux 3.13.0-74-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "flip-lambdas-to-4.3"
npm ERR! node v6.1.0
npm ERR! npm  v3.8.6
npm ERR! code ELIFECYCLE
npm ERR! @jimpick/lambda-comments@0.0.1 flip-lambdas-to-4.3: `babel-node bin/flip-lambdas-to-4.3.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @jimpick/lambda-comments@0.0.1 flip-lambdas-to-4.3 script               'babel-node bin/flip-lambdas-to-4.3.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the @jimpick/lambda-comments package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     babel-node bin/flip-lambdas-to-4.3.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs @jimpick/lambda-comments
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls @jimpick/lambda-comments
npm ERR! There is likely additional logging output above.

Apologies for the output being garbled from copy-and-paste; for some reason, I can't fix it.

@jimpick
Copy link
Owner

jimpick commented May 11, 2016

Just a guess, but I think you might have skipped the step where you run npm run save-cloudformation.

There should be a deploy/state/cloudFormation.json file before you run npm run flip-lambdas-to-4.3.

@julian45
Copy link
Author

Nope, it's definitely there. cating it shows what I'm guessing it should (a bunch of JSON).

@jimpick
Copy link
Owner

jimpick commented May 11, 2016

Hmm, I wonder if you had an issue when CloudFormation ran?

In my deploy/state/cloudFormation.json, I have an entry for the QueueCommentLambdaFunction resource that looks like this:

    {
      "StackName": "lambdaComments",
      "StackId": "arn:aws:cloudformation:us-west-2:013540632128:stack/lambdaComments/f5382f40-1281-11e6-91cb-50a68a0e3256",
      "LogicalResourceId": "QueueCommentLambdaFunction",
      "PhysicalResourceId": "lambdaComments-QueueCommentLambdaFunction-6CFMIA2HEIZ4",
      "ResourceType": "AWS::Lambda::Function",
      "Timestamp": "2016-05-05T05:28:04.038Z",
      "ResourceStatus": "CREATE_COMPLETE"
    },

@julian45
Copy link
Author

julian45 commented May 11, 2016

Huh, that's not there at all. There's a bunch of other stuff, but not QueueCommentLambdaFunction. I'll try sudo npm run delete-cloudformation and try a new one.

@jimpick
Copy link
Owner

jimpick commented May 11, 2016

Maybe check to see if something went wrong in the CloudFormation console, eg.

https://console.aws.amazon.com/cloudformation/home?region=us-west-2#/stacks?filter=active

(You might need to change the region to match where you were installing it)

@julian45
Copy link
Author

Checked that, and with the new stack there apparently is a QueueCommentLambdaFunction created, with a Physical ID, but it doesn't show up in deploy/state/cloudFormation.json.

@jimpick
Copy link
Owner

jimpick commented May 11, 2016

Hmm. That's strange. Maybe try running npm run save-cloudformation again?

I think maybe what happened was that the resources hadn't finished deploying the first time you ran it.

@julian45
Copy link
Author

That made QueueCommentLambdaFunction appear; however, lambda-flipping results in another error:

> @jimpick/lambda-comments@0.0.1 flip-lambdas-to-4.3 /home/ubuntu/lambda-comments
> babel-node bin/flip-lambdas-to-4.3.js

Updating function QueueCommentLambdaFunction to Node 4.3
{ ConfigError: Missing region in config
    at Request.VALIDATE_REGION (/home/ubuntu/lambda-comments/node_modules/aws-sdk/lib/event_listeners.js:81:45)
    at Request.callListeners (/home/ubuntu/lambda-comments/node_modules/aws-sdk/lib/sequential_executor.js:105:20)
    at callNextListener (/home/ubuntu/lambda-comments/node_modules/aws-sdk/lib/sequential_executor.js:95:12)
    at /home/ubuntu/lambda-comments/node_modules/aws-sdk/lib/event_listeners.js:75:9
    at finish (/home/ubuntu/lambda-comments/node_modules/aws-sdk/lib/config.js:299:7)
    at /home/ubuntu/lambda-comments/node_modules/aws-sdk/lib/config.js:315:9
    at SharedIniFileCredentials.get (/home/ubuntu/lambda-comments/node_modules/aws-sdk/lib/credentials.js:126:7)
    at getAsyncCredentials (/home/ubuntu/lambda-comments/node_modules/aws-sdk/lib/config.js:309:24)
    at Config.getCredentials (/home/ubuntu/lambda-comments/node_modules/aws-sdk/lib/config.js:329:9)
    at Request.VALIDATE_CREDENTIALS (/home/ubuntu/lambda-comments/node_modules/aws-sdk/lib/event_listeners.js:70:26)
  message: 'Missing region in config',
  code: 'ConfigError',
  time: 2016-05-11T01:33:31.893Z }
ConfigError: Missing region in config
    at Request.VALIDATE_REGION (/home/ubuntu/lambda-comments/node_modules/aws-sdk/lib/event_listeners.js:81:45)
    at Request.callListeners (/home/ubuntu/lambda-comments/node_modules/aws-sdk/lib/sequential_executor.js:105:20)
    at callNextListener (/home/ubuntu/lambda-comments/node_modules/aws-sdk/lib/sequential_executor.js:95:12)
    at /home/ubuntu/lambda-comments/node_modules/aws-sdk/lib/event_listeners.js:75:9
    at finish (/home/ubuntu/lambda-comments/node_modules/aws-sdk/lib/config.js:299:7)
    at /home/ubuntu/lambda-comments/node_modules/aws-sdk/lib/config.js:315:9
    at SharedIniFileCredentials.get (/home/ubuntu/lambda-comments/node_modules/aws-sdk/lib/credentials.js:126:7)
    at getAsyncCredentials (/home/ubuntu/lambda-comments/node_modules/aws-sdk/lib/config.js:309:24)
    at Config.getCredentials (/home/ubuntu/lambda-comments/node_modules/aws-sdk/lib/config.js:329:9)
    at Request.VALIDATE_CREDENTIALS (/home/ubuntu/lambda-comments/node_modules/aws-sdk/lib/event_listeners.js:70:26)

The rest is the same npm ERR! stuff as the last time I had a similar error.

@jimpick
Copy link
Owner

jimpick commented May 11, 2016

Oh, I just discovered that I had the following environment variable set:

export AWS_REGION=us-west-2

If I unset that, I get the same error. I'll have to fix the code. In the meantime, you can try setting that environment variable. Sorry about that!

@jimpick
Copy link
Owner

jimpick commented May 11, 2016

I just pushed a little fix in 8c7b9ec

@julian45
Copy link
Author

Saw that, and it looks like it should work. To apply it to existing config, should I do some form of git pull (maybe rebase) or just sudo npm run delete-cloudformation, redownload the repo, and start again? (Sorry, not too knowledgeable w/ Git, just enough to do what I need to). Also, setting that env variable doesn't work for some reason, but that commit should fix it.

I'll have to do whatever you say next in the morning, as I have to go hit the hay now.

@jimpick
Copy link
Owner

jimpick commented May 11, 2016

git pull should work. I'm going to re-test an install from a pristine Linux environment to confirm that it all works.

@julian45
Copy link
Author

julian45 commented May 11, 2016

That fix works for lambda-flipping, but now sudo npm run deploy-lambda fails, giving the following:

> @jimpick/lambda-comments@0.0.1 deploy-lambda /home/ubuntu/lambda-comments
> cd build/apex && apex deploy

    Error: function QueueCommentLambdaFunction-VOQWQ93REAME: MissingRegion: could not find region configuration

It looks like you need to do your process.env.REGION magic on this somehow. All the other commands seemed to run fine, save for a few "non-cacheable" items in the compilation script ("tls", "dgram", and "dns")

@jimpick
Copy link
Owner

jimpick commented May 11, 2016

I built a Docker instance on Ubuntu, and I was able to duplicate the situation.

I checked in a fix in commit eb71670

It would fail if ~/.aws/config didn't exist, and AWS_REGION wasn't set (see the
"AWS credentials" section on http://apex.run/ ). Now I set
the AWS_REGION from the value in the .env file.

It seems to work in my VM now, so I'm hoping it will work for you too.

@julian45
Copy link
Author

That works! Almost all of the steps after that worked, save for sudo npm run test, which gives:

> @jimpick/lambda-comments@0.0.1 test /home/ubuntu/lambda-comments
> mocha --compilers js:babel-core/register



  local
    Worker
       should process the action
    Post new comment to the queue
       should return an id
       should fail if there is no data
      1) should catch spam
       should fail with a bad signature
       should allow posting hangul characters

  remote
    Post new comment to the queue
       should return an actionRef (343ms)
       should fail if there is no data (65ms)
       should allow posting hangul characters (325ms)


  8 passing (6s)
  1 failing

  1) local Post new comment to the queue should catch spam:
     Error: timeout of 5000ms exceeded. Ensure the done() callback is being called in this test.

I'm assuming it has something to do with not having an Akismet key set, which I'm working on now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants