npm / npm

This repository is moving to: https://github.com/npm/cli
http://npm.community
17.53k stars 3.02k forks source link

Problems publishing scoped module #12194

Closed tomek-he-him closed 8 years ago

tomek-he-him commented 8 years ago

Hello,

I’m having problems publishing the scoped package @parametric-svg/spec (and any other @parametric-svg/…). I don’t recall running into this before (I last published one of these in December) and I definitely don’t run into this when publishing non-scoped packages.

Here are the steps which led to the problem and what npm complains:

$ npm --version
3.8.5

$ node --version
v5.8.0

$ git clone git@github.com:parametric-svg/-.git parametric-svg

$ cd parametric-svg/packages/spec

$ git checkout spec-v1.2.6

$ npm publish --access=public
npm ERR! publish Failed PUT 404
npm ERR! Linux 4.4.6-300.fc23.x86_64
npm ERR! argv "/home/tomekwi/.local/bin/node" "/home/tomekwi/.local/bin/npm" "publish" "--access=public"
npm ERR! node v5.8.0
npm ERR! npm  v3.8.5
npm ERR! code E404

npm ERR! 404 Not found : @parametric-svg/spec
npm ERR! 404 
npm ERR! 404  '@parametric-svg/spec' 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 
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/tomekwi/Web/parametric-svg/-/packages/spec/npm-debug.log

Since you’ve asked for the contents of npm-debug.log, here they are:

0 info it worked if it ends with ok
1 verbose cli [ '/home/tomekwi/.local/bin/node',
1 verbose cli   '/home/tomekwi/.local/bin/npm',
1 verbose cli   'publish',
1 verbose cli   '--access=public' ]
2 info using npm@3.8.5
3 info using node@v5.8.0
4 verbose publish [ '.' ]
5 silly cache add args [ '.', null ]
6 verbose cache add spec .
7 silly cache add parsed spec Result {
7 silly cache add   raw: '.',
7 silly cache add   scope: null,
7 silly cache add   name: null,
7 silly cache add   rawSpec: '.',
7 silly cache add   spec: '/home/tomekwi/Web/parametric-svg/-/packages/spec',
7 silly cache add   type: 'directory' }
8 verbose addLocalDirectory /home/tomekwi/.npm/@parametric-svg/spec/1.2.6/package.tgz not in flight; packing
9 verbose correctMkdir /home/tomekwi/.npm correctMkdir not in flight; initializing
10 info lifecycle @parametric-svg/spec@1.2.6~prepublish: @parametric-svg/spec@1.2.6
11 silly lifecycle @parametric-svg/spec@1.2.6~prepublish: no script for prepublish, continuing
12 verbose tar pack [ '/home/tomekwi/.npm/@parametric-svg/spec/1.2.6/package.tgz',
12 verbose tar pack   '/home/tomekwi/Web/parametric-svg/-/packages/spec' ]
13 verbose tarball /home/tomekwi/.npm/@parametric-svg/spec/1.2.6/package.tgz
14 verbose folder /home/tomekwi/Web/parametric-svg/-/packages/spec
15 verbose addLocalTarball adding from inside cache /home/tomekwi/.npm/@parametric-svg/spec/1.2.6/package.tgz
16 verbose correctMkdir /home/tomekwi/.npm correctMkdir not in flight; initializing
17 silly cache afterAdd @parametric-svg/spec@1.2.6
18 verbose afterAdd /home/tomekwi/.npm/@parametric-svg/spec/1.2.6/package/package.json not in flight; writing
19 verbose correctMkdir /home/tomekwi/.npm correctMkdir not in flight; initializing
20 verbose afterAdd /home/tomekwi/.npm/@parametric-svg/spec/1.2.6/package/package.json written
21 silly publish { name: '@parametric-svg/spec',
21 silly publish   version: '1.2.6',
21 silly publish   description: 'A specification for full-fledged parametric graphics. In pure SVG.',
21 silly publish   scripts: { test: 'echo "No test yet. More info: https://github.com/parametric-svg/-/issues/11 ." && exit 0' },
21 silly publish   repository:
21 silly publish    { type: 'git',
21 silly publish      url: 'git+ssh://git@github.com/parametric-svg/-.git' },
21 silly publish   keywords:
21 silly publish    [ 'parametric-svg',
21 silly publish      'spec',
21 silly publish      'parametric',
21 silly publish      '2d',
21 silly publish      'graphics',
21 silly publish      'drawing',
21 silly publish      'drawings',
21 silly publish      'cad',
21 silly publish      'svg' ],
21 silly publish   author:
21 silly publish    { name: 'Tomek Wiszniewski',
21 silly publish      email: 't.wiszniewski@gmail.com',
21 silly publish      url: 'https://github.com/tomekwi' },
21 silly publish   license: 'MIT',
21 silly publish   homepage: 'https://github.com/parametric-svg/-/tree/master/packages/spec/#/',
21 silly publish   readme: '<h1 align="center"                                                       id="/">\n  <img alt="parametric.svg" src="https://cdn.rawgit.com/parametric-svg/identity/v1.0.0/logo/basic.svg" />\n</h1>\n\n[![SEE IT IN ACTION! ➔\n](https://img.shields.io/badge/SEE%20IT%20IN%20ACTION!-%E2%9E%94-555555.svg?style=flat-square)\n](http://parametric-svg.js.org)\n\n**A specification for full-fledged parametric graphics. In pure SVG.**\n\n\n\n\n<a                                                        id="/usage"></a>&nbsp;\n\nUsage\n-----\n\n*parametric.svg* is a regular XML namespace. To use it on an element, first set the attribute `xmlns:parametric="//parametric-svg.js.org/v1"` on the element or any of its ancestors. It’s often most convenient to set that on the whole SVG document:\n\n```xml\n<svg version="1.1"\n  xmlns="http://www.w3.org/2000/svg"\n  xmlns:parametric="//parametric-svg.js.org/v1"\n  >\n  ...\n</svg>\n```\n\nOnce you’ve set the `xmlns:parametric` thing, you can use the namespace on attributes:\n\n```xml\n<circle\n  parametric:r="10 * factor"\n             r="50"\n/>\n```\n\n\n<h3 id="/usage/html5">\n  A note about HTML5\n</h3>\n\nHTML5 is not namespace-aware. Prefixing your parametric attribute or element with `parametric:` is enough – you don’t need to declare the `xmlns:parametric` thing beforehand.\n\nWhile XML will allow you to bind our namespace to another prefix like `p:` (through `xmlns:p="//parametric-…"`), it’s normally a bad idea. Only the prefix `parametric:` will work if your SVG is injected into a HTML5 document.\n\n\n\n\n<a                                        id="/parametric-attributes"></a>&nbsp;\n\nParametric attributes\n---------------------\n\nWhenever you set an attribute with the prefix `parametric:` on an element, we’ll bind it to a regular attribute of the same name, without the prefix. For example, the attribute `parametric:height` will be bound to `height`. We’ll call `parametric:height` a *parametric attribute* and `height` its *bound attribute*.\n\nWhen your parametric attribute gets an [update](#/update), the bound attribute is changed – or created, if it doesn’t exist.\n\n\n\n\n<a                                                       id="/syntax"></a>&nbsp;\n\nSyntax\n------\n\nA parametric attribute works like a calculated spreadsheet cell (one with a `=` in front). It can contain any mathematical expression, as long as it keeps to the rules below.\n\n\n<h3 id="/syntax/operators">\n  Operators\n</h3>\n\nWe have operators for all common arithmetic operations such as addition and multiplication. We use conventional infix notation for operators: an operator is placed between its arguments.\n\n```svg\n<circle parametric:r="2 + 3" />\n  <!-- → r="5" -->\n\n<circle parametric:r="2 * 3" />\n  <!-- → r="6" -->\n```\n\nYou can use round parentheses to override the default precedence of operators.\n\n```svg\n<circle parametric:r="2 + 3 * 4" />\n  <!-- → r="14" -->\n\n<circle parametric:r="(2 + 3) * 4" />\n  <!-- → r="20" -->\n```\n\nThe following operators are available:\n\nOperator    | Name                    | Syntax      | Associativity | Example                    | Result\n----------- | ----------------------- | ----------  | ------------- | -------------------------- | ---------------\n`(`, `)`    | Parentheses             | `(x)`       | None          | `2 * (3 + 4)`              | `14`\n`,`         | Parameter separator     | `x, y`      | Left to right | `max(2, 1, 5)`             | `5`\n`+`         | Add                     | `x + y`     | Left to right | `4 + 5`                    | `9`\n`-`         | Subtract                | `x - y`     | Left to right | `7 - 3`                    | `4`\n`-`         | Unary minus             | `-y`        | Right to left | `-4`                       | `-4`\n`*`         | Multiply                | `x * y`     | Left to right | `2 * 3`                    | `6`\n`/`         | Divide                  | `x / y`     | Left to right | `6 / 2`                    | `3`\n`%`         | Modulus                 | `x % y`     | Left to right | `8 % 3`                    | `2`\n`^`         | Power                   | `x ^ y`     | Right to left | `2 ^ 3`                    | `8`\n`!`         | Factorial               | `y!`        | Left to right | `5!`                       | `120`\n`and`       | Logical and             | `x and y`   | Left to right | `true and false  ? 1 : 0`  | `0`\n`not`       | Logical not             | `not y`     | Right to left | `not true        ? 1 : 0`  | `0`\n`or`        | Logical or              | `x or y`    | Left to right | `true or false   ? 1 : 0`  | `1`\n`xor`       | Logical xor             | `x xor y`   | Left to right | `true xor true   ? 1 : 0`  | `0`\n`?` `:`     | Conditional expression  | `x ? y : z` | Right to left | `false ? 1 : -1`           | `-1`\n`==`        | Equal                   | `x == y`    | Left to right | `2 == 4 - 2      ? 1 : 0`  | `1`\n`!=`        | Unequal                 | `x != y`    | Left to right | `2 != 3          ? 1 : 0`  | `1`\n`<`         | Smaller                 | `x < y`     | Left to right | `2 < 3           ? 1 : 0`  | `1`\n`>`         | Larger                  | `x > y`     | Left to right | `2 > 3           ? 1 : 0`  | `0`\n`<=`        | Smallereq               | `x <= y`    | Left to right | `4 <= 3          ? 1 : 0`  | `0`\n`>=`        | Largereq                | `x >= y`    | Left to right | `2 + 4 >= 6      ? 1 : 0`  | `1`\n\n\n<h3 id="/syntax/variables">\n  Variables\n</h3>\n\nA variable is like a spreadsheet cell with a static value (without a `=` in front). You can set your own variables and reference them from parametric attributes – much like you reference a value from a spreadsheet cell.\n\nThere is one difference between a spreadsheet cell and a variable. While a cell has an *address* (like `B1`) – you must give each variable a *name* using lower- and uppercase letters (for example, `baseLength`). You can later use this name to reference a value. This makes your parametric attributes more readable – instead of `(B1 + 3) * 2` you would `(baseLength + 3) * 2`. When you look at the file two weeks later, you’ll still know what’s going on.\n\nIf an expression in a parametric attribute contains a variable which doesn’t have any value, the bound attribute won’t be updated.\n\nHow you assign values to your variables depends on the implementation you’re using. For example, the *[\\<parametric-svg\\>][]* custom element takes variables as attributes:\n\n```html\n<parametric-svg\n  x="5"\n  color="`green`"\n  ><svg>\n  <rect\n    parametric:x="x + 2"\n               x="7"\n    parametric:fill="color"\n               x="green"\n  />\n</svg></parametric-svg>\n```\n\n[\\<parametric-svg\\>]:  https://www.npmjs.com/package/@parametric-svg/element\n\n\n<h3 id="/syntax/types">\n  Data types\n</h3>\n\nA parametric attributes can result in two types of values:\n\n* **number** – A floating-point number like `3` or `29.3`. For example, `parametric:x="3 + 5.4"` will result in `x="8.4"`.\n\n* **string** – A sequence of characters enclosed in backticks (``` `` ```). For example, ``parametric:fill="`green`"`` will result in `fill="green"`. Your string can contain any whitespace inside. There are some characters you may need to escape:\n\nEscape sequence   | Result\n---               | ---\n`` \\` ``          | `` ` `` – backtick\n`\\$`              | `$` – dollar sign (See [Template strings][] for more info.)\n`\\\\`              | `\\` – backslash\n\nIn addition, you can use one more type of value internally in your variables and calculations:\n\n* **boolean** – `true` or `false`. For example, `parametric:r="true ? 5 : 10"` will result in `r="5"`. Keep in mind that the result of a parametric attribute can’t be a boolean – so `parametric:r="true"` is invalid.\n\n[Template strings]:   #/syntax/template-strings\n\n\n<h3 id="/syntax/template-strings">\n  Template strings\n</h3>\n\nYou can embed any expression in your string. Just put it between a `${` and a `}` – we’ll evaluate it and insert the result into your string. You may know this syntax [from ES 2015][].\n\nFor example, if you write ``parametric:d="`M ${1 + 2}, ${3 + 4}`"``, we’ll render it as `d="M 3, 7"`.\n\nIf you ever need to display the raw sequence of characters `${` in your string and don’t want that to be treated as the start of an expression, remember to escape the `$` with a backslash: `\\${`.\n\n[from ES 2015]:   https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/template_strings\n\n\n<h3 id="/syntax/credits">\n  Credits\n</h3>\n\nThe original parametric.svg parser uses [mathjs][] under the hood. We’ve ripped a lot of this specification off their specs. All credits go to the fine [developers of mathjs][].\n\n\n[mathjs]:                http://mathjs.org\n[developers of mathjs]:  https://github.com/josdejong/mathjs/graphs/contributors\n\n\n\n\n<a                                                      id="/license"></a>&nbsp;\n\nLicense\n-------\n\n[MIT][] © [Tomek Wiszniewski][].\n\n[MIT]: ./License.md\n[Tomek Wiszniewski]: https://github.com/tomekwi\n',
21 silly publish   readmeFilename: 'Readme.md',
21 silly publish   bugs: { url: 'https://github.com/parametric-svg/-/issues' },
21 silly publish   _id: '@parametric-svg/spec@1.2.6',
21 silly publish   _shasum: 'b4728604417e9c6fdc7af2bb22e461874ed80981',
21 silly publish   _from: '.' }
22 verbose getPublishConfig undefined
23 silly mapToRegistry name @parametric-svg/spec
24 silly mapToRegistry scope (from package name) @parametric-svg
25 verbose mapToRegistry no registry URL found in name for scope @parametric-svg
26 silly mapToRegistry using default registry
27 silly mapToRegistry registry https://registry.npmjs.org/
28 silly mapToRegistry data Result {
28 silly mapToRegistry   raw: '@parametric-svg/spec',
28 silly mapToRegistry   scope: '@parametric-svg',
28 silly mapToRegistry   name: '@parametric-svg/spec',
28 silly mapToRegistry   rawSpec: '',
28 silly mapToRegistry   spec: 'latest',
28 silly mapToRegistry   type: 'tag' }
29 silly mapToRegistry uri https://registry.npmjs.org/@parametric-svg%2fspec
30 verbose publish registryBase https://registry.npmjs.org/
31 silly publish uploading /home/tomekwi/.npm/@parametric-svg/spec/1.2.6/package.tgz
32 verbose request uri https://registry.npmjs.org/@parametric-svg%2fspec
33 verbose request sending authorization for write operation
34 info attempt registry request try #1 at 7:14:08 AM
35 verbose request using bearer token for auth
36 verbose request id 82652f7bef08e3a4
37 http request PUT https://registry.npmjs.org/@parametric-svg%2fspec
38 http 404 https://registry.npmjs.org/@parametric-svg%2fspec
39 verbose headers { 'content-type': 'application/json',
39 verbose headers   'cache-control': 'max-age=0',
39 verbose headers   'content-length': '21',
39 verbose headers   'accept-ranges': 'bytes',
39 verbose headers   date: 'Tue, 05 Apr 2016 05:14:10 GMT',
39 verbose headers   via: '1.1 varnish',
39 verbose headers   connection: 'keep-alive',
39 verbose headers   'x-served-by': 'cache-fra1248-FRA',
39 verbose headers   'x-cache': 'MISS',
39 verbose headers   'x-cache-hits': '0',
39 verbose headers   'x-timer': 'S1459833249.293789,VS0,VE731' }
40 verbose request invalidating /home/tomekwi/.npm/registry.npmjs.org/_40parametric-svg_252fspec on PUT
41 error publish Failed PUT 404
42 verbose stack Error: Not found : @parametric-svg/spec
42 verbose stack     at makeError (/home/tomekwi/.local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:264:12)
42 verbose stack     at CachingRegistryClient.<anonymous> (/home/tomekwi/.local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:252:14)
42 verbose stack     at Request._callback (/home/tomekwi/.local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:172:14)
42 verbose stack     at Request.self.callback (/home/tomekwi/.local/lib/node_modules/npm/node_modules/request/request.js:199:22)
42 verbose stack     at emitTwo (events.js:100:13)
42 verbose stack     at Request.emit (events.js:185:7)
42 verbose stack     at Request.<anonymous> (/home/tomekwi/.local/lib/node_modules/npm/node_modules/request/request.js:1036:10)
42 verbose stack     at emitOne (events.js:95:20)
42 verbose stack     at Request.emit (events.js:182:7)
42 verbose stack     at IncomingMessage.<anonymous> (/home/tomekwi/.local/lib/node_modules/npm/node_modules/request/request.js:963:12)
43 verbose statusCode 404
44 verbose pkgid @parametric-svg/spec
45 verbose cwd /home/tomekwi/Web/parametric-svg/-/packages/spec
46 error Linux 4.4.6-300.fc23.x86_64
47 error argv "/home/tomekwi/.local/bin/node" "/home/tomekwi/.local/bin/npm" "publish" "--access=public"
48 error node v5.8.0
49 error npm  v3.8.5
50 error code E404
51 error 404 Not found : @parametric-svg/spec
52 error 404
53 error 404 '@parametric-svg/spec' is not in the npm registry.
54 error 404 You should bug the author to publish it (or use the name yourself!)
55 error 404 Note that you can also install from a
56 error 404 tarball, folder, http url, or git url.
57 verbose exit [ 1, true ]
davidmarkclements commented 8 years ago

... I wonder if the dash in your username has something to do with this..

figadore commented 8 years ago

Mine does not have a dash and I have the same error

othiym23 commented 8 years ago

You should open a new issue on npm/registry and link to this one, because this problem is something happening within the registry infrastructure. We've seen it a couple times recently, and I think the @npm/registry-team should be able to get it sorted out pretty quickly.

soldair commented 8 years ago

@tomekwi I believe you may just have to login again. The error message is not very good for this case. I tested everything and it seems to work as long as you are using a valid token.

figadore commented 8 years ago

@soldair I just tried it again after npm add-user, and it did have an effect. Now my error message is You need a paid account to perform this action. I started the issue listed above as a result.

If anyone else tries this, don't forget --access=public after re-logging in, or when attempting to publish a new package, as that appears to be the cause of the referenced issue

soldair commented 8 years ago

because i believe this issue is resolved for @tomekwi. and a different issue is resolved @shinymayhem. I'm going to close this issue.

If anyone else has an issue like this that is unaddressed please email support@npmjs.com or comment on https://github.com/npm/registry/issues/2

tomek-he-him commented 8 years ago

Hi, very sorry I didn’t reply earlier – it’s quite a crazy time for me lately.

It did work, the problem was actually between the chair and the monitor. I was logged in as tomekwi but not as parametric-svg. Thank you for your patience and wonderful support!

By the way, perhaps if you made the error message more accurate than

npm ERR! 404 Not found : @parametric-svg/spec
npm ERR! 404 
npm ERR! 404  '@parametric-svg/spec' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)

…, I’d realize my mistake myself and not bother you here. Just a thought.

Thanks again!

mofc3t15 commented 7 years ago

like @tomekwi said... if you need to upload a scoped package (assume @thescopedpackage/test ) then you need to login (adduser) as 'thescopedpackage'.

for example this is what i did...

`npm adduser username:thenameofscope password: email(public): foo@example.com

npm login --scope=thescopename npm --access=public publish `

huan commented 7 years ago

@mofc3t15 You are my hero!

rfviolato commented 6 years ago

The culprit for me was not having the user that is publishing the package in a org team (https://www.npmjs.com/org/myOrgNameHere/teams) within the organization. I had 0 teams in my org to be more precise, then I created a team, added the user that is publishing the package and it works now.

I have used the following commands to make it work: npm login --scope=myOrgNameHere npm publish --access=public