sinonjs / formatio

The cheesy object formatter

Home Page:https://sinonjs.github.io/formatio/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

formatio package not available.

udaykiranvasireddy opened this issue · comments

Hi,

I am trying to install Sinon and it is throwing an error.
npm ERR! node v6.10.2
npm ERR! npm v3.10.10
npm ERR! code E404
npm ERR! 404 no such package available : @sinonjs/formatio
npm ERR! 404
npm ERR! 404 '@sinonjs/formatio' 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 'nise'

I tried installing from 4.3.0 to 3.2.1 nothing works. This is happening only from yesterday.

Thanks,
Udaykiran

It works fine for me using node 6.10.2

nvm install 6.10.2
######################################################################## 100.0%
Checksums empty
Now using node v6.10.2

npm install sinon@latest --save-dev

sinon-tmp@1.0.0 /Users/morgan/sinon-tmp
└─┬ sinon@4.3.0
  ├─┬ @sinonjs/formatio@2.0.0
  │ └── samsam@1.3.0
  ├── diff@3.4.0
  ├── lodash.get@4.4.2
  ├── lolex@2.3.2
  ├─┬ nise@1.2.5
  │ ├── just-extend@1.1.27
  │ ├─┬ path-to-regexp@1.7.0
  │ │ └── isarray@0.0.1
  │ └── text-encoding@0.6.4
  ├─┬ supports-color@5.2.0
  │ └── has-flag@3.0.0
  └── type-detect@4.0.8

Are you using an npm cache by any chance? (some of those, like sinopia do not understand scoped packages).

Hey,
I get the same error after updating sinon:

npm i --save-dev sinon@latest
npm ERR! code E404
npm ERR! 404 Not Found: @sinonjs/formatio@^2.0.0

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/max/.npm/_logs/2018-02-21T14_40_36_901Z-debug.log

npm --version 5.6.0
node --version 8.9.3

I already purged the npm cache and I'm not using any private npm registries.

Do you have any ideas how I can fix this?

Cheers,
Max

@mroderick Yes, Looks like the issue is with sinopia, I need to encodeURI component like here.
Without sinopia it worked fine for me

Thanks

@udaykiranvasireddy Does your last comment mean that this can be closed?

@mantoni Yes, you can close it. Thanks

@mantoni I am not sure this should be closed yet. I am also having issues:

npm@5.7.1
node@v8.4.0

npm install sinon --save-dev results in debug file including:

23 http fetch GET 404 https://registry.npmjs.org/@sinonjs%2fformatio 3116ms
24 silly fetchPackageMetaData error for @sinonjs/formatio@^2.0.0 404 Not Found: @sinonjs/formatio@^2.0.0

I am still unable to reproduce this issue on both my personal computer and my work computer.

Since we can't reproduce this issue for ourselves, we're going to need more information in order to have any kind of chance of correctly diagnosing it.

Let's start by trying to determine if this problem is with sinonjs, formatio, npm or setup of those affected.

For those that experience this problem, please try the following in your project and report results/errors:

npm install @sinonjs/formatio

If you have a team mate, ask them if they can reproduce the problem, and ask them to contribute their findings to this issue.

I'm not sure if this helps but I had this problem. I managed to identify it as a problem with artifactory we use at work. If I run npm install @sinonjs/formatio via artifactory I get a 404. If I run it directly to NPM it works as expected.

The confusing thing for me was that I thought the use of artifactory was set per project but it turned out because I had logged in there were some settings in ~/.npmrc that were forcing every install to go via artifactory. Removing that file fixed the problem.

The other strange thing I noticed was that it was reporting the 404 from npmjs.org which I dont believe was true - although I can't reproduce this now.

Anyway, if you want me to try anything to narrow down the problem let me know.

Thanks guys, @mrwillihog was right. I had used artifactory on other projects, but it wasn't setup on this one. Also I really would have thought the debug output would at the very least mention some sort of output about using it, but couldn't seem to find it anywhere.

Thanks again, I appreciate how quickly everyone was able to help!

So, I definitely don't have artifactory but removing .npmrc fixed it for me. Much thanks!

You can keep npmrc and add these lines in npmrc to point those packages to npm registry. This worked for me.
@std:registry=http://registry.npmjs.org
@sinonjs:registry=http://registry.npmjs.org

Not sure that would work for everyone. I just tried to install with npm install @sinonjs/formatio --registry="https://registry.npmjs.org/" and I am still getting npm ERR! 404 '@sinonjs/formatio' is not in the npm registry.

@std is only a devDependency. I included it by mistake as a dependency, this has been fixed in sinonjs/sinon#1734 and is on npm.

If you're using a non-standard registry and are experiencing issues installing formatio, you can put this one line in your .npmrc:

@sinonjs:registry=http://registry.npmjs.org

Tried all potential fixes mentioned here, nothing worked, but I finally "solved" by removing the sinon and sinon-chai dependencies from packages.json :-(

@TheMasquerader if you don't give any details on the issue you're experiencing, it's going to be very difficult for anyone to offer any kind of meaningful assistance to you

Running into the same issue -- I tried everything mentioned above:
-- removing the .npmrc (didn't work)
-- Adding a lint to .npmrc (@sinonjs:registry=http://registry.npmjs.org) (didn't work)
-- Installing @sinonjs/formatio along with sinon

I am out of options at this point. Any help is much appreciated.

@shwetasabne this might be a long shot, but have you tried clearing npm's cache?

npm cache clean

I was having the same issue on old node 0.10.25 with npm 1.3.10.

It worked fine before, but since my last try yesterday I had the following error messages:

npm install @sinonjs/formatio
npm ERR! git clone git@github.com:sinonjs/formatio Cloning into bare repository '/root/.npm/_git-remotes/git-github-com-sinonjs-formatio-562b2663'...
npm ERR! git clone git@github.com:sinonjs/formatio Permission denied (publickey).
npm ERR! git clone git@github.com:sinonjs/formatio fatal: Could not read from remote repository.
npm ERR! git clone git@github.com:sinonjs/formatio 
npm ERR! git clone git@github.com:sinonjs/formatio Please make sure you have the correct access rights
npm ERR! git clone git@github.com:sinonjs/formatio and the repository exists.
npm ERR! addLocal Could not install sinonjs/formatio
npm ERR! Error: ENOENT, stat 'sinonjs/formatio'
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Linux 3.16.0-77-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "@sinonjs/formatio"
npm ERR! cwd /root
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path sinonjs/formatio
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /root/npm-debug.log
npm ERR! not ok code 0
root@buildserver0:~# ^C

What I tried:
Clearing the npm cache
Removing the .npmrc

I was able to solve the problem by upgrading to a newer NPM and node version:

root@buildserver0:~# node -v
v8.10.0
root@buildserver0:~# npm -v
5.6.0
root@buildserver0:~# npm install @sinonjs/formatio
npm WARN saveError ENOENT: no such file or directory, open '/root/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/root/package.json'
npm WARN root No description
npm WARN root No repository field.
npm WARN root No README data
npm WARN root No license field.

This might not be the best solution in every case, though.

sinon and @sinonjs/formatio are targeting Node LTS versions and their corresponding npm versions.

Scoped packages can be published and installed as of npm@2 and are supported by the primary npm registry

From https://docs.npmjs.com/misc/scope.

This means that if you want to be able to install current sinon and @sinonjs/formatio for use with (unsupported) node@0.10, you will have to use at least npm@2.

+1 here,
facing the same issue when trying to install a module which has sinon as dependency (which has @sinonjs/formatio@^2.0.0 as dependency)

We were able to solve this problem by fork-ing https://github.com/sinonjs/sinon into https://github.com/MitocGroup/sinon and updating package.json from "@sinonjs/formatio": "^2.0.0" to "@sinonjs/formatio": "git+https://github.com/sinonjs/formatio.git"

Hello All,

Yes, there is a workaround to solve this issue. As mentioned @eistrati. But ideally, this should be addressed. I am using node >8 with npm > 5 and I am facing issue to download this package.

That workaround is really not a good idea. You should only rely on released versions, not latest from master.

One thing that might be worth trying is

npm config set "@sinonjs:registry" http://registry.npmjs.org/

Thank you, Mroderick for the quick reply. Are you able to reproduce the same error on your local?
I tried setting the option you have suggested but it did not work.

Another thing observed is if I try installing it without .npmrc file, it works but if I add an .npmrc file for different registries, it fails.
Could there be an issue with the URL which fails? because what I don't get is the log says metadata for the package cannot be accessed but I can via the browser. I know this sounds weird but I can access the metadata from the browser.

Thank you, Mroderick for the quick reply. Are you able to reproduce the same error on your local?
I tried setting the option you have suggested but it did not work.

@prabhay759 I have never been able to reproduce this issue

Came across this issue, and tried the several approaches suggested:

  • removed ~/.npmrc,
  • restored and added @sinonjs:registry setting to ~/.npmrc,
  • npm cache clean and install again
  • npm config set

In all the cases, i was able to install using node version 8 (and corresponding npm), but wasn't able to install with node version 6 (and corresponding npm).

Figured this could be a problem with my node binary / work tree setup ( was using n to switch between the versions), since my teammates weren't facing the same issues.

Tried using nvm instead, for switching node versions, and it worked (could install) with version node 6. Sticking to this for now.

@SirR4T thank you for sharing your solution with everyone. It'll be interesting to see, if others come back with similar experiences 👍

@mroderick Drilling down more with .npmrc file. It works with multiple scoped and unscoped regeistries but if I store auth token in the below form it fails:

@<somescope>:registry=https://someregistry.io/artifactory/api/npm/npm-release-local/
registry=https://registry.npmjs.org/
_auth=<authToken value>
always-auth=true
email=someemail@mail.com

Interestingly this fails only for this package but works for all other unscoped and scoped packages I came across.

Is there a way you could reproduce this and help resolving it?

Another user reports solving this for themselves by adding @sinonjs:registry=http://registry.npmjs.org to their .npmrc

@GhosalkarPratik I am still unable to reproduce this issue locally. I've taken your example and tried to turn it into a shareable test case to reproduce the issue.

https://github.com/mroderick/formatio-not-available

People that are affected by this issue, would you mind taking the test case for a spin, and report back in this thread?

@mroderick To my surprise the issue is resolved now. The only change I see now in package-lock.json is:
"resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-2.0.0.tgz",
instead of
"resolved": "http://registry.npmjs.org/@sinonjs/formatio/-/formatio-2.0.0.tgz",

I am not sure how this self-resolved but its working now.

@GhosalkarPratik interesting, perhaps this works for other people!

It would be great if some of those still affected by this bug would try replacing the url in their package-lock.json and report back results.

On Unix™️

sed -i 's/http\:\/\/registry.npmjs.org\/@sinonjs\/formatio/https\:\/\/registry.npmjs.org\/@sinonjs\/formatio/g' ./package-lock.json
npm install

On macOS

sed -i -e 's/http\:\/\/registry.npmjs.org\/@sinonjs\/formatio/https\:\/\/registry.npmjs.org\/@sinonjs\/formatio/g' ./package-lock.json
npm install

This hasn't seen any new reports for more than three months. I assume that people have fixed their local configs, and am closing this.

Might be offtopic, but I had similar error:
npm ERR! 404 Not Found: @sinonjs/commons@1.0.2
and fixed it by running command:
npm install @sinonjs/commons --registry="https://registry.npmjs.org/
Thanks

I can recreate this failure if this is included in my .npmrc file:

_auth="test"

The _ is causing the failure for me.

Strange thing though, this works: npm install @sinonjs/formatio@3.0.0
This fails: npm install @sinonjs/commons@1.0.2