GithubHelp home page GithubHelp logo

workshopper / how-to-npm Goto Github PK

View Code? Open in Web Editor NEW
1.1K 1.1K 212.0 301 KB

A module to teach you how to module.

Home Page: https://www.npmjs.com/package/how-to-npm

License: ISC License

JavaScript 100.00%
javascript nodeschool npm

how-to-npm's People

Contributors

ashleygwilliams avatar bengl avatar cakenggt avatar cedced19 avatar daudich avatar emilabraham avatar emmaramirez avatar erictleung avatar eunsucking avatar isaacs avatar johnbrett avatar johndeyrup avatar jpwesselink avatar juanpicado avatar linclark avatar llkats avatar marocchino avatar martinheidegger avatar mohamed3on avatar petert82 avatar pippinlee avatar royneau avatar schellingerhout avatar stefanmaric avatar terrygyde avatar watilde avatar yashdeeph709 avatar yeqing123 avatar zeke avatar zkat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

how-to-npm's Issues

Workshop not working properly

Its not working as should work, I runned the first one ok, then its entry on loop and not go to the next exercise. :(

suggestion for package niceties

Return the values for the description and the repository URL so that the user knows that their code was correct, which is better than just checking that they exist. This will ensure that the user put their URL in quotes correctly (which I messed up and only fixed when I tried to do lesson 8).

Also, my understanding is that Node 3.* doesn't require READMEs, so perhaps that instruction could be deleted.

I'm just going through this lesson at Node School SF so I'm adding suggestions in real time as we work through. Thanks!

How to UPDATE the package?

I am up to step 14 Update, but I couldn't get through.

If I run npm-outdated, I have
Package Current Wanted Latest Location
@linclark/pkg 1.0.2 1.0.2 1.0.1 @myusername/npm-dev

I only can update the Current version 1.0.2 to 1.0.1, but how could the latest version 1.0.1 is lower than the wanted or current version? How I can update it?

Thank you.

Publish verify passes without actually publishing

It seems that the publish task verification passes even though the package wasn't published to the local registry.

See:

$ how-to-npm verify
npm ERR! Darwin 13.4.0
npm ERR! argv "node" "/usr/local/bin/npm" "--color=always" "view" "how-to-npm-test"
npm ERR! node v0.10.24
npm ERR! npm  v2.5.0
npm ERR! code E404

npm ERR! 404 missing : how-to-npm-test
npm ERR! 404
npm ERR! 404 'how-to-npm-test' 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!     /Users/Turgeon/temp/how-to-npm/npm-debug.log
Uh oh!
It looks like you didn't successfully publish the how-to-npm-test
package.  Try again!

In order to view your package content, I just ran this command:

  npm view how-to-npm-test

Run that command yourself to see what it prints out.


The `npm view` command is a great way to view package details,
to see what you just published, and to check if a name is already taken.

Now that you've published your first package here in make-believe npm
workshop land, go out and write a real thing to share with real humans!

You don't have to just share code for other people, though.  There are
also benefits to breaking up your code into small manageable pieces, even
if you are only using them all yourself.

You can imagine that your future self and your past self are the two
other developers on your team.  (Scheduling meetings is pretty tricky.)

Run `how-to-npm` to go on to the next adventure!

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@     YOUR SOLUTION IS CORRECT!     @@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@


$

Running npm view does not return any results at this point.

Install A Module: Unexpected token

Running on Freebsd, tried with both npm version 2.14.4 and 3.3.5, same results.

$ npm install @linclark/pkg
npm WARN package.json @jecxjo/[email protected] No repository field.
npm WARN package.json @jecxjo/[email protected] No README data
npm ERR! registry error parsing json
npm ERR! FreeBSD 10.1-RELEASE-p19
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "@linclark/pkg"
npm ERR! node v4.1.1
npm ERR! npm  v2.14.4

npm ERR! Unexpected token �
�¿½ï¿½body.jsonI�
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

Debug log generated:

$ cat npm-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'install',
1 verbose cli   '@linclark/pkg' ]
2 info using [email protected]
3 info using [email protected]
4 verbose install initial load of /usr/home/jeff/sandbox/node/how-to-npm/package.json
5 warn package.json @jecxjo/[email protected] No repository field.
6 warn package.json @jecxjo/[email protected] No README data
7 verbose readDependencies loading dependencies from /usr/home/jeff/sandbox/node/how-to-npm/package.json
8 silly cache add args [ '@linclark/pkg', null ]
9 verbose cache add spec @linclark/pkg
10 silly cache add parsed spec Result {
10 silly cache add   raw: '@linclark/pkg',
10 silly cache add   scope: '@linclark',
10 silly cache add   name: '@linclark/pkg',
10 silly cache add   rawSpec: '',
10 silly cache add   spec: '*',
10 silly cache add   type: 'range' }
11 silly addNamed @linclark/pkg@*
12 verbose addNamed "*" is a valid semver range for @linclark/pkg
13 silly addNameRange { name: '@linclark/pkg', range: '*', hasData: false }
14 silly mapToRegistry name @linclark/pkg
15 silly mapToRegistry scope (from package name) @linclark
16 verbose mapToRegistry no registry URL found in name for scope @linclark
17 silly mapToRegistry using default registry
18 silly mapToRegistry registry http://localhost:15443/
19 silly mapToRegistry uri http://localhost:15443/@linclark%2fpkg
20 verbose addNameRange registry:http://localhost:15443/@linclark%2fpkg not in flight; fetching
21 verbose request uri http://localhost:15443/@linclark%2fpkg
22 verbose request no auth needed
23 info attempt registry request try #1 at 15:41:12
24 verbose request id 0d434097addd7d59
25 http request GET http://localhost:15443/@linclark%2fpkg
26 http 200 http://localhost:15443/@linclark%2fpkg
�¿½ï¿½body.jsonI�¿½ï¿½
28 error registry error parsing json
29 verbose headers { 'content-length': '512',
29 verbose headers   connection: 'close',
29 verbose headers   date: 'Thu, 08 Oct 2015 15:41:12 GMT' }
30 silly get cb [ 200,
30 silly get   { 'content-length': '512',
30 silly get     connection: 'close',
30 silly get     date: 'Thu, 08 Oct 2015 15:41:12 GMT' } ]
31 verbose stack SyntaxError: Unexpected token �
�¿½ï¿½body.jsonI�¿½
31 verbose stack     at Object.parse (native)
31 verbose stack     at CachingRegistryClient.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:198:23)
31 verbose stack     at Request._callback (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:171:14)
31 verbose stack     at Request.self.callback (/usr/local/lib/node_modules/npm/node_modules/request/request.js:198:22)
31 verbose stack     at emitTwo (events.js:87:13)
31 verbose stack     at Request.emit (events.js:172:7)
31 verbose stack     at Request.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/request.js:1073:14)
31 verbose stack     at emitOne (events.js:82:20)
31 verbose stack     at Request.emit (events.js:169:7)
31 verbose stack     at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/request.js:1019:12)
32 verbose cwd /usr/home/jeff/sandbox/node/how-to-npm
33 error FreeBSD 10.1-RELEASE-p19
34 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "@linclark/pkg"
35 error node v4.1.1
36 error npm  v2.14.4
37 error Unexpected token �
�¿½ï¿½body.jsonI�
38 error If you need help, you may report this error at:
38 error     <https://github.com/npm/npm/issues>
39 verbose exit [ 1, true ]


npm ERR! Please include the following file with any support request:
npm ERR!     /usr/home/jeff/sandbox/node/how-to-npm/npm-debug.log

11 Dist Tag/ Have problem to add a tag

I have problem in this section
When I enter npm dist-tag add [email protected] old
It gave me following error

Caimings-MacBook-Pro:nodejs NLStom$ npm dist-tag add [email protected] old
npm ERR! Darwin 15.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "dist-tag" "add" "[email protected]" "old"
npm ERR! node v4.4.7
npm ERR! npm v2.15.8
npm ERR! code E404

npm ERR! 404 missing : -/package/tom5208/dist-tags

Also in 08 Publish section
when I enter npm view tom5208, it doesn't print out anything.

I suspect my package's name is not tom5208? below are few line of my package.json file
{
"name": "tom5208",
"version": "1.0.1",
"description": "this is begining",
"main": "index.js",

So I guess my package's name is tom5208

Please help...

TypeError: process.stdin.setRawMode is not a function

I get this error while trying to install the module.
I used npm install -g how-to-npm

TypeError: process.stdin.setRawMode is not a function
    at module.exports (C:\Users\Kothapalli\AppData\Roaming\npm\node_modules\how-to-npm\node_modules\adventure\lib\menu.js:51:19)
    at Shop.showMenu (C:\Users\Kothapalli\AppData\Roaming\npm\node_modules\how-to-npm\node_modules\adventure\index.js:258:16)
    at Shop.execute (C:\Users\Kothapalli\AppData\Roaming\npm\node_modules\how-to-npm\node_modules\adventure\index.js:122:14)
    at Shop.shop.execute (C:\Users\Kothapalli\AppData\Roaming\npm\node_modules\how-to-npm\index.js:37:45)
    at Object.<anonymous> (C:\Users\Kothapalli\AppData\Roaming\npm\node_modules\how-to-npm\index.js:86:8)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Function.Module.runMain (module.js:457:10)

how-to-npm verify on the Login module doesn't run

I checked my working directory, I am in the how-to-npm folder and when I run the command to verify, This is what I get.

Kothapalli@KOTHAPALLI-PC ~/how-to-npm (master)
$ npm whoami
kotapi

Kothapalli@KOTHAPALLI-PC ~/how-to-npm (master)
$ how-to-npm verify
'c:\Program' is not recognized as an internal or external command,
operable program or batch file.

Uh oh!
It looks like something went wrong

YOUR SOLUTION IS NOT CORRECT!

Issue with 04 Install A Module

This exercise does not work for me. I get a 404 when it's attempted to fetch the 'pkg' module from the NPM registry:

$ npm install @linclark/pkg
npm WARN package.json @seb/[email protected] No description
npm WARN package.json @seb/[email protected] No repository field.
npm WARN package.json @seb/[email protected] No README data
npm ERR! Darwin 14.3.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "@linclark/pkg"
npm ERR! node v0.12.1
npm ERR! npm  v2.12.0
npm ERR! code E404

npm ERR! 404 missing : @linclark/pkg
npm ERR! 404
npm ERR! 404 '@linclark/pkg' 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 '@seb/how-to-npm'
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!     /Users/seb/Work/Training/nodejs/nodeschool/core/how-to-npm/npm-debug.log

Here is the content of npm-debug.log:

$ cat npm-debug.log
0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/local/bin/npm', 'install', '@linclark/pkg' ]
2 info using [email protected]
3 info using [email protected]
4 verbose node symlink /usr/local/bin/node
5 verbose install initial load of /Users/seb/Work/Training/nodejs/nodeschool/core/how-to-npm/package.json
6 warn package.json @seb/[email protected] No description
7 warn package.json @seb/[email protected] No repository field.
8 warn package.json @seb/[email protected] No README data
9 verbose readDependencies loading dependencies from /Users/seb/Work/Training/nodejs/nodeschool/core/how-to-npm/package.json
10 silly cache add args [ '@linclark/pkg', null ]
11 verbose cache add spec @linclark/pkg
12 silly cache add parsed spec { raw: '@linclark/pkg',
12 silly cache add   scope: '@linclark',
12 silly cache add   name: '@linclark/pkg',
12 silly cache add   rawSpec: '',
12 silly cache add   spec: '*',
12 silly cache add   type: 'range' }
13 silly addNamed @linclark/pkg@*
14 verbose addNamed "*" is a valid semver range for @linclark/pkg
15 silly addNameRange { name: '@linclark/pkg', range: '*', hasData: false }
16 silly mapToRegistry name @linclark/pkg
17 silly mapToRegistry scope (from package name) @linclark
18 verbose mapToRegistry no registry URL found in name for scope @linclark
19 silly mapToRegistry using default registry
20 silly mapToRegistry registry http://localhost:15443/
21 silly mapToRegistry uri http://localhost:15443/@linclark%2fpkg
22 verbose addNameRange registry:http://localhost:15443/@linclark%2fpkg not in flight; fetching
23 verbose request uri http://localhost:15443/@linclark%2fpkg
24 verbose request no auth needed
25 info attempt registry request try #1 at 15:27:13
26 verbose request id dbe68dc9739d7d4b
27 http request GET http://localhost:15443/@linclark%2fpkg
28 http 404 http://localhost:15443/@linclark%2fpkg
29 verbose headers { 'content-type': 'application/json',
29 verbose headers   date: 'Fri, 26 Jun 2015 13:27:13 GMT',
29 verbose headers   connection: 'keep-alive',
29 verbose headers   'transfer-encoding': 'chunked' }
30 silly get cb [ 404,
30 silly get   { 'content-type': 'application/json',
30 silly get     date: 'Fri, 26 Jun 2015 13:27:13 GMT',
30 silly get     connection: 'keep-alive',
30 silly get     'transfer-encoding': 'chunked' } ]
31 verbose stack Error: missing : @linclark/pkg
31 verbose stack     at CachingRegistryClient.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:247:14)
31 verbose stack     at Request._callback (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:170:14)
31 verbose stack     at Request.self.callback (/usr/local/lib/node_modules/npm/node_modules/request/request.js:197:22)
31 verbose stack     at Request.emit (events.js:110:17)
31 verbose stack     at Request.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/request.js:1050:14)
31 verbose stack     at Request.emit (events.js:129:20)
31 verbose stack     at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/request.js:996:12)
31 verbose stack     at IncomingMessage.emit (events.js:129:20)
31 verbose stack     at _stream_readable.js:908:16
31 verbose stack     at process._tickCallback (node.js:355:11)
32 verbose statusCode 404
33 verbose pkgid @linclark/pkg
34 verbose cwd /Users/seb/Work/Training/nodejs/nodeschool/core/how-to-npm
35 error Darwin 14.3.0
36 error argv "node" "/usr/local/bin/npm" "install" "@linclark/pkg"
37 error node v0.12.1
38 error npm  v2.12.0
39 error code E404
40 error 404 missing : @linclark/pkg
40 error 404
40 error 404 '@linclark/pkg' is not in the npm registry.
40 error 404 You should bug the author to publish it (or use the name yourself!)
40 error 404 It was specified as a dependency of '@seb/how-to-npm'
40 error 404
40 error 404 Note that you can also install from a
40 error 404 tarball, folder, http url, or git url.
41 verbose exit [ 1, true ]

Maintained?

There are plenty of open PR's. Most of which seem to be good. @linclark @isaacs Do you intend to maintain it? Is there a way to get updates in this nice (and very important) adventure?

The first test nukes NPM

I ran how-to-npm verify for the very first test. When the tool/test found that I have an out of date version, it reported it as so. Of course, after that, I could not find npm on bash. I can verify that npm was installed, because that's how I installed how-to-npm in the first place. sudo or not, it nukes my npm install every time.

I had to reinstall node each time get things working again. Thanks a lot, how-to-npm!

My system details
OS X 10.10.3
Node v0.12.4

Progress did not update

Hi @ashleygwilliams !
I don't know why you closed my issue #41 , its still not solved:

So, my environment was approved :
verifying that npm is installed...
You have version 3.3.8 installed. Great!
Now let's see what the latest version is... wait for it...
The latest npm is: 3.3.8
Congratulations!
You have a recent version of npm installed!

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@ YOUR SOLUTION IS CORRECT! @@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

But when I go to menu again its still are in question 1, and stay in this "loop":
status of the menu

04: OK vs NOT OK distinction is confusing

This distinction could be confusing to new users. Since they probably don't know what OK is supposed to look like, it's asking them to make a choice which they don't have the information to make. It should instead be clear about the output that they should use to determine whether it's ok or not ok.

Make sure we have NodeJS installed

Those of us new to npm might not even have NodeJS installed yet on our machines. Please place a link to install up top of the README to make sure we're ready to run npm from our terminals :-)

Facing problem in task 10.

when I type how-to-npm verify in the terminal. It gives me the following error.

  module.js:340
  throw err;
      ^
Error: Cannot find module '/home/ubuntu/.config/how-to-npm/registry/nodeproject/body.json'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.exports.verify (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/how-to-npm/problems/10-publish-again.js:33:14)
at Shop.verify (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/how-to-npm/node_modules/adventure/index.js:157:15)
at Shop.execute (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/how-to-npm/node_modules/adventure/index.js:76:14)
at Shop.shop.execute (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/how-to-npm/index.js:37:45)
at Object.<anonymous> (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/how-to-npm/index.js:86:8)
at Module._compile (module.js:456:26)

Dist Tag commands give a 404 error

Everything works fine until I use what appears to be the correct command to add a dist tag.
Considering that I was able to use this command to add a dist tag to a module I created and published to the real npmjs.com using what I have learned from the tutorial up to this point, I am fairly confident that this is an issue with the dummy server set up for the tutorial and not with the command I entered.
Here is the text of npm-debug.log:
0 info it worked if it ends with ok
1 verbose cli [ 'node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'dist-tag',
1 verbose cli 'add',
1 verbose cli '[email protected]',
1 verbose cli 'useless' ]
2 info using [email protected]
3 info using [email protected]
4 verbose dist-tag add useless to [email protected]
5 silly mapToRegistry name agc-retestpackage
6 silly mapToRegistry using default registry
7 silly mapToRegistry registry http://localhost:15443/
8 silly mapToRegistry uri http://localhost:15443/agc-retestpackage
9 verbose request uri http://localhost:15443/-/package/agc-retestpackage/dist-tags
10 verbose request no auth needed
11 info attempt registry request try #1 at 9:15:14 PM
12 verbose request id 875c22cbd3f2979b
13 http request GET http://localhost:15443/-/package/agc-retestpackage/dist-tags
14 http 404 http://localhost:15443/-/package/agc-retestpackage/dist-tags
15 verbose headers { 'content-type': 'application/json',
15 verbose headers date: 'Fri, 31 Jul 2015 01:15:15 GMT',
15 verbose headers connection: 'keep-alive',
15 verbose headers 'transfer-encoding': 'chunked' }
16 verbose stack Error: missing : -/package/agc-retestpackage/dist-tags
16 verbose stack at CachingRegistryClient. (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:247:14)
16 verbose stack at Request._callback (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:170:14)
16 verbose stack at Request.self.callback (/usr/local/lib/node_modules/npm/node_modules/request/request.js:197:22)
16 verbose stack at Request.emit (events.js:110:17)
16 verbose stack at Request. (/usr/local/lib/node_modules/npm/node_modules/request/request.js:1050:14)
16 verbose stack at Request.emit (events.js:129:20)
16 verbose stack at IncomingMessage. (/usr/local/lib/node_modules/npm/node_modules/request/request.js:996:12)
16 verbose stack at IncomingMessage.emit (events.js:129:20)
16 verbose stack at _stream_readable.js:908:16
16 verbose stack at process._tickCallback (node.js:355:11)
17 verbose statusCode 404
18 verbose cwd /Users/adamcraig/Sites/node_practice/how-to-npm2
19 error Darwin 14.4.0
20 error argv "node" "/usr/local/bin/npm" "dist-tag" "add" "[email protected]" "useless"
21 error node v0.12.7
22 error npm v2.13.2
23 error code E404
24 error 404 missing : -/package/agc-retestpackage/dist-tags
25 verbose exit [ 1, true ]

Stalled on 'Outdated' challenge

Trying to run npm outdated gets me:

npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "outdated"
npm ERR! node v5.2.0
npm ERR! npm  v3.5.2
npm ERR! code E404

npm ERR! 404 missing : how-to-npm
npm ERR! 404
npm ERR! 404  '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!     /Users/phildini/Repos/nodeschool/how-to-npm/npm-debug.log

Not sure how to proceed?

Support i18n

Nowaday, some major workshoppers supported i18n and it's obviously helpful especially for beginners. I would like to get your thoughts on multilingual support.

Technically, current how-to-npm is using the adventure module and it can't support i18n. Also, current way to display question texts is not easy to integrate workshopper-adventure which are used by another workshoppers to support i18n.

e.g.

This PR was too large to review. Let me subdivide the PR to do again realistically:

  1. separate question texts from actual codes
  2. Integrate workshopper-adventure instead of the adventure
  3. Add another language sources

Cannot verify 10 Publish Again: throws an error

$ how-to-npm verify
module.js:341
throw err;
^

Error: Cannot find module '/Users/tomasvolta/.config/how-to-npm/registry/@tomasvolta/npm/body.json'
at Function.Module._resolveFilename (module.js:339:15)
at Function.Module._load (module.js:290:25)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at Object.exports.verify (/usr/local/lib/node_modules/how-to-npm/problems/10-publish-again.js:33:14)
at Shop.verify (/usr/local/lib/node_modules/how-to-npm/node_modules/adventure/index.js:157:15)
at Shop.execute (/usr/local/lib/node_modules/how-to-npm/node_modules/adventure/index.js:76:14)
at Shop.shop.execute (/usr/local/lib/node_modules/how-to-npm/index.js:37:45)
at Object. (/usr/local/lib/node_modules/how-to-npm/index.js:86:8)
at Module._compile (module.js:413:34)
Bons-MacBook-Pro:npm tomasvolta$ how-to-npm verify
module.js:341
throw err;
^

Error: Cannot find module '/Users/tomasvolta/.config/how-to-npm/registry/@tomasvolta/npm/body.json'
at Function.Module._resolveFilename (module.js:339:15)
at Function.Module._load (module.js:290:25)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at Object.exports.verify (/usr/local/lib/node_modules/how-to-npm/problems/10-publish-again.js:33:14)
at Shop.verify (/usr/local/lib/node_modules/how-to-npm/node_modules/adventure/index.js:157:15)
at Shop.execute (/usr/local/lib/node_modules/how-to-npm/node_modules/adventure/index.js:76:14)
at Shop.shop.execute (/usr/local/lib/node_modules/how-to-npm/index.js:37:45)
at Object. (/usr/local/lib/node_modules/how-to-npm/index.js:86:8)
at Module._compile (module.js:413:34)

Typo

In section 07 Publish, 'too' should be 'to':

Try it now. There's not much too it.

dist-tag removal challenge 403's when resetting latest, then gets inconsistent

I tried this a few times, always results with the same scenario when I'm on the "dist-tag removal" challenge:

$ npm dist-tag add [email protected] latest
npm ERR! Darwin 14.1.0
npm ERR! argv "node" "/Users/tdd/.nvm/v0.10.36/bin/npm" "dist-tag" "add" "[email protected]" "latest"
npm ERR! node v0.10.36
npm ERR! npm  v2.7.6
npm ERR! code E403

npm ERR! Registry returned 403 for PUT on http://localhost:15443/-/package/learn-how-to-npm/dist-tags/latest
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/tdd/perso/node/learn-how-to-npm/npm-debug.log

$ npm dist-tag ls learn-how-to-npm 
latest: 1.1.0

I've got two versions in the registry: 1.1.0 and 1.2.0. This is regardless of another tag existing or not on these versions.

Add Dist Tag How to npm

nirmalrizal:~/workspace (master) $ npm dist-tag add [email protected] ["npm-nodecamp"]
npm ERR! Linux 4.2.0-c9
npm ERR! argv "/home/ubuntu/.nvm/versions/node/v4.5.0/bin/node" "/home/ubuntu/.nvm/versions/node/v4.5.0/bin/npm" "dist-tag" "add" "[email protected]" "[npm-nodecamp]"
npm ERR! node v4.5.0
npm ERR! npm v3.10.7
npm ERR! code E404

npm ERR! 404 missing : -/package/npm-codecamp/dist-tags

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

Space in "Program Files" makes lesson 00 impossible

Running Windows and having a space in your node filepath makes completing lesson 00 impossible since it thinks that the rest of the filepath is an argument. Error text below:

verifying that npm is installed...
Uh oh!  npm had a problem! {"killed":false,"code":1,"signal":null,"cmd":"C:\\WIN
DOWS\\system32\\cmd.exe /s /c \"C:\\Program Files\\nodejs\\npm.CMD --version\""}

'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
#########################################
###   YOUR SOLUTION IS NOT CORRECT!   ###
#########################################

04 Install A Module Could not install linclark/pkg

Error:

npm install @linclark/pkg
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No README data
npm ERR! git clone [email protected]:linclark/pkg Cloning into bare repository '/Users/XumaK/.npm/_git-remotes/git-github-com-linclark-pkg-37223368'...
npm ERR! git clone [email protected]:linclark/pkg ERROR: Repository not found.
npm ERR! git clone [email protected]:linclark/pkg fatal: Could not read from remote repository.
npm ERR! git clone [email protected]:linclark/pkg
npm ERR! git clone [email protected]:linclark/pkg Please make sure you have the correct access rights
npm ERR! git clone [email protected]:linclark/pkg and the repository exists.
npm ERR! addLocal Could not install linclark/pkg
npm ERR! Error: ENOENT, stat 'linclark/pkg'
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:
npm ERR! http://github.com/npm/npm/issues

npm ERR! System Darwin 14.1.0
npm ERR! command "/Users/XumaK/.nvm/v0.10.38/bin/node" "/Users/XumaK/.nvm/v0.10.38/bin/npm" "install" "@linclark/pkg"
npm ERR! cwd /Users/XumaK/Documents/Pruebas/nodeschool/how-to-npm/folder
npm ERR! node -v v0.10.38
npm ERR! npm -v 1.4.28
npm ERR! path linclark/pkg
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/XumaK/Documents/Pruebas/nodeschool/how-to-npm/folder/npm-debug.log
npm ERR! not ok code 0

Log:

0 info it worked if it ends with ok
1 verbose cli [ '/Users/XumaK/.nvm/v0.10.38/bin/node',
1 verbose cli '/Users/XumaK/.nvm/v0.10.38/bin/npm',
1 verbose cli 'install',
1 verbose cli '@linclark/pkg' ]
2 info using [email protected]
3 info using [email protected]
4 warn package.json [email protected] No repository field.
5 warn package.json [email protected] No README data
6 verbose readDependencies using package.json deps
7 verbose cache add [ '@linclark/pkg', null ]
8 verbose cache add name=undefined spec="@linclark/pkg" args=["@linclark/pkg",null]
9 verbose parsed url { protocol: null,
9 verbose parsed url slashes: null,
9 verbose parsed url auth: null,
9 verbose parsed url host: null,
9 verbose parsed url port: null,
9 verbose parsed url hostname: null,
9 verbose parsed url hash: null,
9 verbose parsed url search: null,
9 verbose parsed url query: null,
9 verbose parsed url pathname: '@linclark/pkg',
9 verbose parsed url path: '@linclark/pkg',
9 verbose parsed url href: '@linclark/pkg' }
10 verbose cache add name="" spec="linclark/pkg" args=["","linclark/pkg"]
11 verbose parsed url { protocol: null,
11 verbose parsed url slashes: null,
11 verbose parsed url auth: null,
11 verbose parsed url host: null,
11 verbose parsed url port: null,
11 verbose parsed url hostname: null,
11 verbose parsed url hash: null,
11 verbose parsed url search: null,
11 verbose parsed url query: null,
11 verbose parsed url pathname: 'linclark/pkg',
11 verbose parsed url path: 'linclark/pkg',
11 verbose parsed url href: 'linclark/pkg' }
12 silly lockFile d3fddcad-linclark-pkg linclark/pkg
13 verbose lock linclark/pkg /Users/XumaK/.npm/d3fddcad-linclark-pkg.lock
14 info maybeGithub Attempting linclark/pkg from git://github.com/linclark/pkg
15 silly lockFile 197f35eb-git-github-com-linclark-pkg git://github.com/linclark/pkg
16 verbose lock git://github.com/linclark/pkg /Users/XumaK/.npm/197f35eb-git-github-com-linclark-pkg.lock
17 verbose addRemoteGit [ 'git://github.com/linclark/pkg', 'master' ]
18 verbose git clone git://github.com/linclark/pkg Cloning into bare repository '/Users/XumaK/.npm/_git-remotes/git-github-com-linclark-pkg-197f35eb'...
18 verbose git clone git://github.com/linclark/pkg fatal: remote error:
18 verbose git clone git://github.com/linclark/pkg Repository not found.
19 silly lockFile 197f35eb-git-github-com-linclark-pkg git://github.com/linclark/pkg
20 silly lockFile 197f35eb-git-github-com-linclark-pkg git://github.com/linclark/pkg
21 info maybeGithub Attempting linclark/pkg from git+ssh://[email protected]:linclark/pkg
22 silly lockFile 37223368-git-github-com-linclark-pkg [email protected]:linclark/pkg
23 verbose lock [email protected]:linclark/pkg /Users/XumaK/.npm/37223368-git-github-com-linclark-pkg.lock
24 verbose addRemoteGit [ '[email protected]:linclark/pkg', 'master' ]
25 error git clone [email protected]:linclark/pkg Cloning into bare repository '/Users/XumaK/.npm/_git-remotes/git-github-com-linclark-pkg-37223368'...
25 error git clone [email protected]:linclark/pkg ERROR: Repository not found.
25 error git clone [email protected]:linclark/pkg fatal: Could not read from remote repository.
25 error git clone [email protected]:linclark/pkg
25 error git clone [email protected]:linclark/pkg Please make sure you have the correct access rights
25 error git clone [email protected]:linclark/pkg and the repository exists.
26 silly lockFile 37223368-git-github-com-linclark-pkg [email protected]:linclark/pkg
27 silly lockFile 37223368-git-github-com-linclark-pkg [email protected]:linclark/pkg
28 silly lockFile d3fddcad-linclark-pkg linclark/pkg
29 silly lockFile d3fddcad-linclark-pkg linclark/pkg
30 error addLocal Could not install linclark/pkg
31 error Error: ENOENT, stat 'linclark/pkg'
32 error If you need help, you may report this entire log,
32 error including the npm and node versions, at:
32 error http://github.com/npm/npm/issues
33 error System Darwin 14.1.0
34 error command "/Users/XumaK/.nvm/v0.10.38/bin/node" "/Users/XumaK/.nvm/v0.10.38/bin/npm" "install" "@linclark/pkg"
35 error cwd /Users/XumaK/Documents/Pruebas/nodeschool/how-to-npm/folder
36 error node -v v0.10.38
37 error npm -v 1.4.28
38 error path linclark/pkg
39 error code ENOENT
40 error errno 34
41 verbose exit [ 34, true ]

cannot install module

Prints this error:
C:\Users\iliu\how-to-npm>npm install @linclark/pkg
npm WARN package.json @iliu/[email protected] No README data
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "node" "C:\Users\iliu\AppData\Roaming\npm\node_modules\npm
\bin\npm-cli.js" "install" "@linclark/pkg"
npm ERR! node v0.12.5
npm ERR! npm v2.12.0

npm ERR! undefined is not a function
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\iliu\how-to-npm\npm-debug.log

C:\Users\iliu\how-to-npm>

debug log

0 info it worked if it ends with ok
1 verbose cli [ 'node',
1 verbose cli 'C:\Users\iliu\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '@linclark/pkg' ]
2 info using [email protected]
3 info using [email protected]
4 verbose install initial load of C:\Users\iliu\how-to-npm\package.json
5 warn package.json @iliu/[email protected] No README data
6 verbose installManyTop reading scoped package data from C:\Users\iliu\how-to-npm\node_modules\npm-debug.log\package.json
7 verbose readDependencies loading dependencies from C:\Users\iliu\how-to-npm\package.json
8 silly cache add args [ '@linclark/pkg', null ]
9 verbose cache add spec @linclark/pkg
10 silly cache add parsed spec { raw: '@linclark/pkg',
10 silly cache add scope: '@linclark',
10 silly cache add name: '@linclark/pkg',
10 silly cache add rawSpec: '',
10 silly cache add spec: '',
10 silly cache add type: 'range' }
11 silly addNamed @linclark/pkg@

12 verbose addNamed "" is a valid semver range for @linclark/pkg
13 silly addNameRange { name: '@linclark/pkg', range: '
', hasData: false }
14 silly mapToRegistry name @linclark/pkg
15 silly mapToRegistry scope (from package name) @linclark
16 verbose mapToRegistry no registry URL found in name for scope @linclark
17 silly mapToRegistry using default registry
18 silly mapToRegistry registry http://localhost:15443/
19 silly mapToRegistry uri http://localhost:15443/@linclark%2fpkg
20 verbose addNameRange registry:http://localhost:15443/@linclark%2fpkg not in flight; fetching
21 verbose request uri http://localhost:15443/@linclark%2fpkg
22 verbose request no auth needed
23 info attempt registry request try #1 at 2:57:49 PM
24 verbose request id 2efef41c2d77fc0b
25 http request GET http://localhost:15443/@linclark%2fpkg
26 http 200 http://localhost:15443/@linclark%2fpkg
27 silly get cb [ 200,
27 silly get { 'content-length': '2403',
27 silly get 'content-type': 'application/json',
27 silly get connection: 'close',
27 silly get date: 'Thu, 02 Jul 2015 21:57:49 GMT' } ]
28 verbose get saving @linclark/pkg to C:\Users\iliu\AppData\Roaming\npm-cache\localhost_15443_40linclark_252fpkg.cache.json
29 verbose stack TypeError: undefined is not a function
29 verbose stack at calculateOwner (C:\Users\iliu\AppData\Roaming\npm\node_modules\npm\lib\utils\correct-mkdir.js:37:24)
29 verbose stack at C:\Users\iliu\AppData\Roaming\npm\node_modules\npm\lib\utils\correct-mkdir.js:23:22
29 verbose stack at FSReqWrap.oncomplete (evalmachine.:95:15)
30 verbose cwd C:\Users\iliu\how-to-npm
31 error Windows_NT 6.1.7601
32 error argv "node" "C:\Users\iliu\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "@linclark/pkg"
33 error node v0.12.5
34 error npm v2.12.0
35 error undefined is not a function
36 error If you need help, you may report this error at:
36 error https://github.com/npm/npm/issues
37 verbose exit [ 1, true ]

Package Niceties fails on verify

Trying to verify adding repo field to package.json and creating README.md.

Terminal output:

andy@fordprefect$ how-to-npm>>sudo how-to-npm verify
ERROR: No adventure is currently selected. Select an adventure from the menu.
Mon Dec 26 16:19:43
andy@fordprefect$ how-to-npm>>how-to-npm verify
npm ERR! Linux 4.8.13-200.fc24.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "i"
npm ERR! node v7.3.0
npm ERR! npm  v4.0.5
npm ERR! path /home/andy/projects/node.js/how-to-npm/node_modules/.staging
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall mkdir

npm ERR! Error: EACCES: permission denied, mkdir '/home/andy/projects/node.js/how-to-npm/node_modules/.staging'
npm ERR!  { Error: EACCES: permission denied, mkdir '/home/andy/projects/node.js/how-to-npm/node_modules/.staging'
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: '/home/andy/projects/node.js/how-to-npm/node_modules/.staging' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/andy/projects/node.js/how-to-npm/npm-debug.log

Uh oh!
It looks like something went wrong
#########################################
###   YOUR SOLUTION IS NOT CORRECT!   ###
#########################################

contents of npm-debug.log:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'i' ]
2 info using [email protected]
3 info using [email protected]
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly install normalizeTree
8 silly loadCurrentTree Finishing
9 silly loadIdealTree Starting
10 silly install loadIdealTree
11 silly cloneCurrentTree Starting
12 silly install cloneCurrentTreeToIdealTree
13 silly cloneCurrentTree Finishing
14 silly loadShrinkwrap Starting
15 silly install loadShrinkwrap
16 silly loadShrinkwrap Finishing
17 silly loadAllDepsIntoIdealTree Starting
18 silly install loadAllDepsIntoIdealTree
19 silly loadAllDepsIntoIdealTree Finishing
20 silly loadIdealTree Finishing
21 silly currentTree @the-octagon/[email protected]
21 silly currentTree └── @linclark/[email protected]
22 silly idealTree @the-octagon/[email protected]
22 silly idealTree └── @linclark/[email protected]
23 silly generateActionsToTake Starting
24 silly install generateActionsToTake
25 silly generateActionsToTake Finishing
26 silly diffTrees action count 0
27 silly decomposeActions action count 0
28 silly runTopLevelLifecycles Starting
29 silly install runPreinstallTopLevelLifecycles
30 silly preinstall @the-octagon/[email protected]
31 info lifecycle @the-octagon/[email protected]~preinstall: @the-octagon/[email protected]
32 silly lifecycle @the-octagon/[email protected]~preinstall: no script for preinstall, continuing
33 silly executeActions Starting
34 silly install executeActions
35 silly doSerial global-install 0
36 silly doParallel fetch 0
37 verbose correctMkdir /home/andy/.npm/_locks correctMkdir not in flight; initializing
38 verbose lock using /home/andy/.npm/_locks/staging-7356ea95aafd18c0.lock for /home/andy/projects/node.js/how-to-npm/node_modules/.staging
39 verbose unlock done using /home/andy/.npm/_locks/staging-7356ea95aafd18c0.lock for /home/andy/projects/node.js/how-to-npm/node_modules/.staging
40 silly rollbackFailedOptional Starting
41 silly rollbackFailedOptional Finishing
42 silly runTopLevelLifecycles Finishing
43 silly install printInstalled
44 verbose stack Error: EACCES: permission denied, mkdir '/home/andy/projects/node.js/how-to-npm/node_modules/.staging'
45 verbose cwd /home/andy/projects/node.js/how-to-npm
46 error Linux 4.8.13-200.fc24.x86_64
47 error argv "/usr/bin/node" "/usr/bin/npm" "i"
48 error node v7.3.0
49 error npm  v4.0.5
50 error path /home/andy/projects/node.js/how-to-npm/node_modules/.staging
51 error code EACCES
52 error errno -13
53 error syscall mkdir
54 error Error: EACCES: permission denied, mkdir '/home/andy/projects/node.js/how-to-npm/node_modules/.staging'
54 error  { Error: EACCES: permission denied, mkdir '/home/andy/projects/node.js/how-to-npm/node_modules/.staging'
54 error   errno: -13,
54 error   code: 'EACCES',
54 error   syscall: 'mkdir',
54 error   path: '/home/andy/projects/node.js/how-to-npm/node_modules/.staging' }
55 error Please try running this command again as root/Administrator.
56 verbose exit [ -13, true ]

Tried manually creating .staging directory with sudo, but script then fails on rmdir. When running script with sudo, the following is output:

andy@fordprefect$ how-to-npm>>sudo how-to-npm verify
ERROR: No adventure is currently selected. Select an adventure from the menu.

npm publish has resulted in error "You need to authorize this machine using `npm adduser`"

Hi,

In the 08 Publish chapter I was not able to npm publish against the .npmrc local environment. However it worked when the .npmrc file removed and with a connection to https://www.npmjs.com/. None of the following chapters worked correctly either against this local environment, and all worked well again without the .npmrc file and with a connection to https://www.npmjs.com/.

I once went through the 02 Login chapter smoothly and npm whoami returned the correct info. At this point running npm whoami also results in authentication errors.

Looking at the path that userconfig in .npmrc pointed to (userconfig = /Users/xiaoli.shen/.config/how-to-npm/npmrc), there is no such file or folder named npmrc, which might be the reason for the authentication errors.

I'm using version 2.0.0 of how-to-npm and on Mac OS 10.9.5

My npm-debug.log is as follows:

0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/local/bin/npm', 'adduser' ]
2 info using [email protected]
3 info using [email protected]
4 verbose adduser before first PUT { _id: 'org.couchdb.user:alabebop',
4 verbose adduser   name: 'alabebop',
4 verbose adduser   password: 'XXXXX',
4 verbose adduser   email: '[email protected]',
4 verbose adduser   type: 'user',
4 verbose adduser   roles: [],
4 verbose adduser   date: '2015-06-11T09:07:53.405Z' }
5 verbose request uri http://localhost:15443/-/user/org.couchdb.user:alabebop
6 verbose request new user, so can't send auth
7 info attempt registry request try #1 at 11:07:53
8 verbose request id 8f19ff7f3662cb4c
9 http request PUT http://localhost:15443/-/user/org.couchdb.user:alabebop
10 info retry will retry, error on last attempt: Error: connect ECONNREFUSED
11 info attempt registry request try #2 at 11:08:03
12 http request PUT http://localhost:15443/-/user/org.couchdb.user:alabebop
13 info retry will retry, error on last attempt: Error: connect ECONNREFUSED
14 info attempt registry request try #3 at 11:09:03
15 http request PUT http://localhost:15443/-/user/org.couchdb.user:alabebop
16 verbose request invalidating /Users/xiaoli.shen/.npm/localhost_15443/-/user/org.couchdb.user_3Aalabebop on PUT
17 verbose adduser back [ { [Error: connect ECONNREFUSED]
17 verbose adduser     code: 'ECONNREFUSED',
17 verbose adduser     errno: 'ECONNREFUSED',
17 verbose adduser     syscall: 'connect' },
17 verbose adduser   undefined,
17 verbose adduser   undefined ]
18 verbose stack Error: connect ECONNREFUSED
18 verbose stack     at exports._errnoException (util.js:746:11)
18 verbose stack     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1010:19)
19 verbose cwd /Users/xiaoli.shen/projects/nodeschool/how-to-npm
20 error Darwin 13.4.0
21 error argv "node" "/usr/local/bin/npm" "adduser"
22 error node v0.12.4
23 error npm  v2.11.1
24 error code ECONNREFUSED
25 error errno ECONNREFUSED
26 error syscall connect
27 error Error: connect ECONNREFUSED
27 error     at exports._errnoException (util.js:746:11)
27 error     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1010:19)
27 error  { [Error: connect ECONNREFUSED]
27 error   code: 'ECONNREFUSED',
27 error   errno: 'ECONNREFUSED',
27 error   syscall: 'connect' }
28 error If you are behind a proxy, please make sure that the
28 error 'proxy' config is set properly.  See: 'npm help config'
29 verbose exit [ 1, true ]

'c:\program' is not recognized as a command

i'm using windows 7 and everything went well until i reach chapter 05 : LOGIN. it says the following

'c:\Program' is not recognized as an internal or external command,
operable program or batch file.

Uh oh!
It looks like something went wrong

YOUR SOLUTION IS NOT CORRECT!

i guess it's referring to my node installation folder('c:\program files\nodejs')
ps: this is not my first nodeschool workshop and this is the first time something similar comes up

Lead Maintainer wanted

Moving the workshoppers under the workshopper org umbrella means that there is no longer a signal of who the implicit "lead maintainer" (i.e., the original author) is. Following the example of the other workshoppers it would be awesome to have a small group of people who are invested in the future of how-to-npm to volunteer to join a how-to-npm lead maintainers team. We'll make a GitHub team to list the volunteers.

how-to-npm on windows

Can't get past the very first step (verifying npm is up-to-date).

C:\Users\Quasar\Desktop\how-to-npm>how-to-npm verify
verifying that npm is installed...
Uh oh!  npm had a problem! {"killed":false,"code":1,"signal":null,"cmd":"C:\\Win
dows\\system32\\cmd.exe /s /c \"C:\\Program Files\\nodejs\\npm.CMD --version\""}

'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
#########################################
###   YOUR SOLUTION IS NOT CORRECT!   ###
#########################################

Looks like something to do with the space in the Program Files folder.
Anything I can do about this other than re-installing Node itself to a different folder that doesn't have space characters?

03 login : unable to create new user

Trying to go through 03 login but unable to add a user with the adduser command.

This is the message i get in my npm-debug file:

0 info it worked if it ends with ok
1 verbose cli [ '/home/ubuntu/.nvm/versions/node/v4.1.1/bin/node',
1 verbose cli   '/home/ubuntu/.nvm/versions/node/v4.1.1/bin/npm',
1 verbose cli   'whoami' ]
2 info using [email protected]
3 info using [email protected]
4 verbose stack Error: this command requires you to be logged in.
4 verbose stack     at EventEmitter.whoami (/home/ubuntu/.nvm/versions/node/v4.1.1/lib/node_modules/npm/lib/whoami.js:41:18)
4 verbose stack     at Object.commandCache.(anonymous function) (/home/ubuntu/.nvm/versions/node/v4.1.1/lib/node_modules/npm/lib/npm.js:216:13)
4 verbose stack     at EventEmitter.<anonymous> (/home/ubuntu/.nvm/versions/node/v4.1.1/lib/node_modules/npm/bin/npm-cli.js:74:30)
4 verbose stack     at doNTCallback0 (node.js:407:9)
4 verbose stack     at process._tickCallback (node.js:336:13)
5 verbose cwd /home/ubuntu/workspace
6 error Linux 4.2.0-c9
7 error argv "/home/ubuntu/.nvm/versions/node/v4.1.1/bin/node" "/home/ubuntu/.nvm/versions/node/v4.1.1/bin/npm" "whoami"
8 error node v4.1.1
9 error npm  v3.5.3
10 error code ENEEDAUTH
11 error need auth this command requires you to be logged in.
12 error need auth You need to authorize this machine using `npm adduser`
13 verbose exit [ 1, true ]

and this is what i get after trying to add a user:

yannhulot:~/workspace/ProjectFolder $ npm adduser
Username: yann
Password: 
Email: (this IS public) [email protected]
npm ERR! Linux 4.2.0-c9
npm ERR! argv "/home/ubuntu/.nvm/versions/node/v4.1.1/bin/node" "/home/ubuntu/.nvm/versions/node/v4.1.1/bin/npm" "adduser"
npm ERR! node v4.1.1
npm ERR! npm  v3.5.3
npm ERR! code E400

npm ERR! Unknown error while authenticating : -/user/org.couchdb.user:yann
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /home/ubuntu/workspace/ProjectFolder/npm-debug.log
yannhulot:~/workspace/ProjectFolder $ 

Any help on how to solve the problem would be appreciated. Thanks.

package.json not found

In section 06, how-to-npm verify tells you to return to section 01 if your package.json has a syntax error (such as a missing comma). The error messages in section 01 and 06 suggest that there is no package.json file in this case. There should be a more helpful error message

failed npm install -g how-to-mpn

here is my problem, what is wrong? Pls help me, thanks!

`C:\Windows\System32>npm -v
2.15.9

C:\Windows\System32>node -v
v4.5.0

C:\Windows\System32>npm install -g how-to-npm
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "D:\ruanjian\nj\node.exe" "D:\ruanjian\nj\node_modules\npm\bin\npm-cli.js" "install" "-g" "how-to-npm"
npm ERR! node v4.5.0
npm ERR! npm v2.15.9

npm ERR! shasum check failed for C:\Users\ADMINI~1\AppData\Local\Temp\npm-7900-ecd30d56\registry.npmjs.org\how-to-npm-\how-to-npm-2.0.0.tgz
npm ERR! Expected: 590f1a8d0b63ed7c9fe7cceaf58c6fb7bdcc8980
npm ERR! Actual: 62ffe898b5e66570e0842dba367b63c107032527
npm ERR! From: https://registry.npmjs.org/how-to-npm/-/how-to-npm-2.0.0.tgz
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues
`

06-npm-test clarity?

It could just be me but I have no clue what I'm doing here? What exactly goes in the "node test.js" file? I almost get the impression that the user is suppose to understand everything about node.js at this step. imagine seeing this for the first time

"scripts": {
"test": "node test.js"
}

All I know is that this is a json object.

npm dist add not working

this is my command i keep trying to run and it won't work. npm dist-tag add [email protected] latest

here is the log:

0 info it worked if it ends with ok
1 verbose cli [ 'node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'dist-tag',
1 verbose cli 'add',
1 verbose cli '[email protected]',
1 verbose cli 'latest' ]
2 info using [email protected]
3 info using [email protected]
4 verbose node symlink /usr/local/bin/node
5 verbose dist-tag add latest to [email protected]
6 silly mapToRegistry name test
7 silly mapToRegistry using default registry
8 silly mapToRegistry registry http://localhost:15443/
9 silly mapToRegistry uri http://localhost:15443/test
10 verbose request uri http://localhost:15443/-/package/test/dist-tags
11 verbose request no auth needed
12 info attempt registry request try #1 at 11:53:24
13 verbose request id 62b5673de17b3467
14 http request GET http://localhost:15443/-/package/test/dist-tags
15 http 404 http://localhost:15443/-/package/test/dist-tags
16 verbose headers { 'content-type': 'application/json',
16 verbose headers date: 'Tue, 05 May 2015 16:53:24 GMT',
16 verbose headers connection: 'keep-alive',
16 verbose headers 'transfer-encoding': 'chunked' }
17 verbose stack Error: missing : -/package/test/dist-tags
17 verbose stack at CachingRegistryClient. (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:254:14)
17 verbose stack at Request._callback (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:178:14)
17 verbose stack at Request.self.callback (/usr/local/lib/node_modules/npm/node_modules/request/request.js:344:22)
17 verbose stack at Request.emit (events.js:110:17)
17 verbose stack at Request. (/usr/local/lib/node_modules/npm/node_modules/request/request.js:1239:14)
17 verbose stack at Request.emit (events.js:129:20)
17 verbose stack at IncomingMessage. (/usr/local/lib/node_modules/npm/node_modules/request/request.js:1187:12)
17 verbose stack at IncomingMessage.emit (events.js:129:20)
17 verbose stack at _stream_readable.js:908:16
17 verbose stack at process._tickCallback (node.js:355:11)
18 verbose statusCode 404
19 verbose cwd /Applications/NODEJS/howtonpm
20 error Darwin 14.3.0
21 error argv "node" "/usr/local/bin/npm" "dist-tag" "add" "[email protected]" "latest"
22 error node v0.12.0
23 error npm v2.7.3
24 error code E404
25 error 404 missing : -/package/test/dist-tags
26 verbose exit [ 1, true ]

Stucking at level 10.

I was stuck in level 10, and I followed the following step.

Step 1. I change the module version

npm version 3.0.0

v3.0.0

Step 2. Type "npm publish", it shows

npm publish

npm ERR! Linux 2.6.32-24-generic-pae
npm ERR! argv "node" "[MY_HOME_ROOT]/node-v0.12.4-linux-x86/bin/npm" "publish"
npm ERR! node v0.12.4
npm ERR! npm v2.11.2
npm ERR! code ENEEDAUTH
npm ERR! need auth auth required for publishing
npm ERR! need auth You need to authorize this machine using npm adduser
npm ERR! Please include the following file with any support request:
npm ERR! [MY_HOME_ROOT]/node_tutorials/tmp/npm-ch2/npm-debug.log

Step 3. Finally, I type "how-to-npm verify" and it shows

how-to-npm verify

module.js:338
throw err;
^
Error: Cannot find module '/home/G12/yutingkao23/.config/how-to-npm/registry/yuting/body.json'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.exports.verify (/mnt/autofs/home/G12/yutingkao23/node_tutorials/node_modules/how-to-npm/problems/10-publish-again.js:33:14)
at Shop.verify (/mnt/autofs/home/G12/yutingkao23/node_tutorials/node_modules/how-to-npm/node_modules/adventure/index.js:157:15)
at Shop.execute (/mnt/autofs/home/G12/yutingkao23/node_tutorials/node_modules/how-to-npm/node_modules/adventure/index.js:76:14)
at Shop.shop.execute (/mnt/autofs/home/G12/yutingkao23/node_tutorials/node_modules/how-to-npm/index.js:37:45)
at Object. (/mnt/autofs/home/G12/yutingkao23/node_tutorials/node_modules/how-to-npm/index.js:86:8)
at Module._compile (module.js:460:26)

Is there any problem with above steps ?

Install Node Breaks Node

The first lesson, when I run install in the first lesson, it breaks my node installation....this has happened twice now, after I reinstalled node.

npm view in stubbed-out npm-world hangs

Not sure if this is a problem with my setup or if it's a problem with how-to-npm, but when I do npm view my-package-name as instructed by the verification message in challenge 07 (Publish), it just hangs. Outside the directory I created for the how-to-npm workshopper, npm view whatever works just fine, returning data about packages that exist or an 404 error for packages that don't exist.

io.js compatibility

It doesn't work with io.js. It displays the following error:

node: ../deps/uv/src/unix/stream.c:1174: uv_shutdown: Assertion `(stream->type == UV_TCP || stream->type == UV_NAMED_PIPE) && "uv_shutdown (unix) only supports uv_handle_t right now"' failed.
Aborted (core dumped)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.