-
Notifications
You must be signed in to change notification settings - Fork 107
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
how-to-npm chapter 08 publish - Cannot get publish to run #1561
Comments
Hugh, I encountered the same thing. After a bit of digging, I found that the mock registry was failing to write the
Thanks for posting this, it made me aware that I hadn't messed something up big time! |
Well done benetd, that fixed my identical issue too! It still occurs over a year later. I confess, I wasn't following the instructions in Free Code Camp about using cloud9, I was using my local PC instead (which runs Win 10, hence the problem occurring in Windows). Due to having bad experiences with Cloud9 when trying the FCC MongoDB challenge, and had to give up on it. |
@Benetd Thank! This solved my issue as well. The only slightly interesting thing in my case is that my name contains a '-' (dash). Maybe it is related. And the really frustrating part is, in my case, this would crash the local webserver running the mock npmjs service. It turns out you can restart the service though by running exercise 2 again... |
Yes, thank you @Benetd! Just ran into the same issue using Windows 10, but that fixed it immediately. Much appreciated. |
@Benetd |
…ctory under dash directory The JSON sent by `npm publish` contains the property `versions.XXX.dist.tarball` which contains the scope name twice for a scoped package; for example: "http://localhost:15443/@chad/myhowtonpm/-/@chad/myhowtonpm-1.0.0.tgz". The mock registry server attempts to remove the second occurrence of `@scope` from the file path, which causes an error if users try to create another package into which they install the package created in the workshopper using the mock server. The path should be left as-is to match the tarball property in `body.json` so npm can GET it. Removing this code has the additional benefit of fixing a bug on Windows because the regex does not consider backslashes in the path. See: workshopper#68 Fixes: workshopper#122 Fixes: nodeschool/discussions#1561 Fixes: nodeschool/discussions#2049
…ctory under dash directory The JSON sent by `npm publish` contains the property `versions.XXX.dist.tarball` which contains the scope name twice for a scoped package; for example: "http://localhost:15443/@chad/myhowtonpm/-/@chad/myhowtonpm-1.0.0.tgz". The mock registry server attempts to remove the second occurrence of `@scope` from the file path, which causes an error if users try to create another package into which they install the package created in the workshopper using the mock server. The path should be left as-is to match the tarball property in `body.json` so npm can GET it. Removing this code has the additional benefit of fixing a bug on Windows because the regex does not consider backslashes in the path. See: workshopper#68 Fixes: workshopper#122 Fixes: nodeschool/discussions#1561 Fixes: nodeschool/discussions#2049
Hello,
I've seen this documented but none of the solutions work. When I run npm publish, I get the following:
E:\development\nodejs\how-to-npm>npm publish
npm ERR! publish Failed PUT 404
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "E:\development\nodejs\node.exe" "C:\Users\Hugh\AppData\Roa
ming\npm\node_modules\npm\bin\npm-cli.js" "publish"
npm ERR! node v4.2.2
npm ERR! npm v3.5.0
npm ERR! code E404
npm ERR! 404 missing : @hferguson/how-to-npm
npm ERR! 404
npm ERR! 404 '@hferguson/how-to-npm' 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! E:\development\nodejs\how-to-npm\npm-debug.log
Oddly though if I run how-to-npm right after, it tells me that my solution is correct. However, eventually I get an unhandled exception by chapter 10 if I leave chapter 08 in this state.
Here is the log file.
npm-debug.txt
Any suggestions?
-Hugh Ferguson
PS I also tried uninstalling and reinstalling the how-to-npm package, which only succeeded after a reboot.
PPS This is Windows 7 environment.
The text was updated successfully, but these errors were encountered: