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 install of published package fails #110

Open
TrentonAdams opened this issue Apr 19, 2019 · 1 comment
Open

npm install of published package fails #110

TrentonAdams opened this issue Apr 19, 2019 · 1 comment

Comments

@TrentonAdams
Copy link

TrentonAdams commented Apr 19, 2019

This is a (Bug Report / Feature Proposal)

Description

Cannot npm install a package published to the registry.

For bug reports:

  • What went wrong?
    The s3 bucket has...
$ aws s3 ls some-registry-prod/intelli-notes-common/
2019-04-19 00:28:45       7072 1.0.47.tgz
2019-04-19 00:30:31       7071 1.0.48.tgz
2019-04-19 01:21:01       7077 1.0.49.tgz
2019-04-19 01:21:01      11907 index.json

The install fails...

$ npm install intelli-notes-common
npm ERR! Only absolute URLs are supported

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/trenta/.npm/_logs/2019-04-19T07_29_16_405Z-debug.log
  • What did you expect should have happened?
    It should have installed the npm package

  • What was the config / env variables you used?
    export CODEBOX_REGION="us-west-2" # Set the AWS region you wish your registry to be deployed to
    export CODEBOX_ADMINS="TrentonAdams" # Comma seperated list of github usernames (e.g. "jon,kadi"), these users will be the only ones able to publish
    export CODEBOX_REGISTRY="https://registry.npmjs.org/" # The NPM mirror you wish to proxy through to
    export CODEBOX_BUCKET="some-npm-registry" # The name of the bucket in which you wish to store your packages
    export CODEBOX_GITHUB_URL="https://api.github.com/" # The GitHub / GitHub Enterprise api url
    export CODEBOX_GITHUB_CLIENT_ID="" # The client id for your GitHub application
    export CODEBOX_GITHUB_SECRET="" # The secret for your GitHub application
    export CODEBOX_RESTRICTED_ORGS="" # OPTIONAL: Comma seperated list of github organisations to only allow access to users in that org (e.g. "craftship,myorg"). Useful if using public GitHub for authentication, as by default all authenticated users would have access.

  • What stacktrace or error message did you
    experience?

Log output...

0 info it worked if it ends with ok
1 verbose cli [ '/home/trenta/.nvm/versions/node/v11.8.0/bin/node',
1 verbose cli   '/home/trenta/.nvm/versions/node/v11.8.0/bin/npm',
1 verbose cli   'install',
1 verbose cli   'intelli-notes-common' ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session 13ea6922d9af3cd0
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 200 https://dfdfdsfasdfafe.execute-api.us-west-2.amazonaws.com/prod/registry/intelli-notes-common 582ms
8 silly fetchPackageMetaData error for intelli-notes-common@latest Only absolute URLs are supported
9 timing stage:rollbackFailedOptional Completed in 2ms
10 timing stage:runTopLevelLifecycles Completed in 2654ms
11 verbose stack TypeError: Only absolute URLs are supported
11 verbose stack     at getNodeRequestOptions (/home/trenta/.nvm/versions/node/v11.8.0/lib/node_modules/npm/node_modules/node-fetch-npm/src/request.js:131:11)
11 verbose stack     at fetch.Promise (/home/trenta/.nvm/versions/node/v11.8.0/lib/node_modules/npm/node_modules/node-fetch-npm/src/index.js:44:21)
11 verbose stack     at new Promise (<anonymous>)
11 verbose stack     at fetch (/home/trenta/.nvm/versions/node/v11.8.0/lib/node_modules/npm/node_modules/node-fetch-npm/src/index.js:41:10)
11 verbose stack     at retry (/home/trenta/.nvm/versions/node/v11.8.0/lib/node_modules/npm/node_modules/make-fetch-happen/index.js:332:14)
11 verbose stack     at /home/trenta/.nvm/versions/node/v11.8.0/lib/node_modules/npm/node_modules/promise-retry/index.js:29:24
12 verbose cwd /home/trenta/Documents/development/node/intelli-notes/server
13 verbose Linux 4.15.0-46-generic
14 verbose argv "/home/trenta/.nvm/versions/node/v11.8.0/bin/node" "/home/trenta/.nvm/versions/node/v11.8.0/bin/npm" "install" "intelli-notes-common"
15 verbose node v11.8.0
16 verbose npm  v6.5.0
17 error Only absolute URLs are supported
18 verbose exit [ 1, true ]

Interestingly enough, npm knows what the latest version of the the package is...

$ npm view intelli-notes-common
npm ERR! Cannot read property '1.0.49' of undefined
Unhandled rejection TypeError: Cannot read property '1.0.49' of undefined
    at BB.try (/home/trenta/.nvm/versions/node/v11.8.0/lib/node_modules/npm/lib/view.js:222:57)
    at tryCatcher (/home/trenta/.nvm/versions/node/v11.8.0/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
    at Function.Promise.attempt.Promise.try (/home/trenta/.nvm/versions/node/v11.8.0/lib/node_modules/npm/node_modules/bluebird/js/release/method.js:39:29)
    at prettyView (/home/trenta/.nvm/versions/node/v11.8.0/lib/node_modules/npm/lib/view.js:186:16)
    at BB.all.results.map (/home/trenta/.nvm/versions/node/v11.8.0/lib/node_modules/npm/lib/view.js:173:35)
    at Array.map (<anonymous>)
    at /home/trenta/.nvm/versions/node/v11.8.0/lib/node_modules/npm/lib/view.js:173:24
    at f (/home/trenta/.nvm/versions/node/v11.8.0/lib/node_modules/npm/node_modules/once/once.js:25:25)
    at /home/trenta/.nvm/versions/node/v11.8.0/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:78:16
    at /home/trenta/.nvm/versions/node/v11.8.0/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:105:12
    at f (/home/trenta/.nvm/versions/node/v11.8.0/lib/node_modules/npm/node_modules/once/once.js:25:25)
    at RegClient.<anonymous> (/home/trenta/.nvm/versions/node/v11.8.0/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:324:12)
    at Request._callback (/home/trenta/.nvm/versions/node/v11.8.0/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:216:14)
    at Request.self.callback (/home/trenta/.nvm/versions/node/v11.8.0/lib/node_modules/npm/node_modules/request/request.js:185:22)
    at Request.emit (events.js:197:13)
    at Request.<anonymous> (/home/trenta/.nvm/versions/node/v11.8.0/lib/node_modules/npm/node_modules/request/request.js:1161:10)

Additional Data

$ serverless --version
1.41.0
$ npm --version
6.5.0
$ node --version
v11.8.0

@ibliskavka
Copy link

I had a similar issue. I resolved by adding the following path to serverless.yml
provider.environment.apiEndpoint

with my API Gateway endpoint path ending with /prod/registry

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

2 participants