-
Notifications
You must be signed in to change notification settings - Fork 189
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
Add npm init step to npm installation #141
Add npm init step to npm installation #141
Conversation
Add instructions to the npm installation section. Create a new folder for slides and then do npm init in that folder. If slides are stored away from the directory where 'node_modules' exists, then there will be an error when attempting to generate slides for a file not found issue.
Hi @stevewillson. Thanks for your suggestion! Right now, I'm not sure of the benefit of having users going through the Can you please provide some more insights with maybe current output of commands and what you expect your pull request will fix? Thanks |
It does seem that since npm v5, the install command will fail if a package.json file is not already present. It will succeed but report errors if only the node_modules directory is present. The simplest way to fix is to add this command to the start:
Another option is to force yes on all questions when running the
I prefer the first because I don't agree that the defaults for npm init are good. For what it's worth, the following command succeeds without error when run in an empty directory.
|
I am new to using npm and followed the current steps listed in the README.adoc file. Install node.js
This stored the packages in my user's home directory (/home/user). I store the directory where I want to generate slides in another directory within my user's home directory (/home/user/slides). I attempt to generate slides by executing a 'generate_slides.js' file. generate_slides.js:
I create a file called 'pres.adoc' and attempt to generate the .html file:
After trying to generate the slides, I receive the following error:
I was able to generate the slides by using:
I am also able to generate the slides by moving the I realize that the default values for Let me know if you need any more information to re-create the error. |
I observed the same behavior when using npm 5. It seems like this is a bug
in npm. It puts node_modules in the parent directory if the current
directory does not have a package.json file or node_modules folder.
|
Thanks @stevewillson for the full context. @mojavelinux is it possible that they already reverted that behavior? I run npm 5.3.0. I've checked the changelog quickly and didn't see anything regarding What version of |
I tried with both npm 5.3.0 and 5.4.2, same results. npm add does not function correctly if the directory is empty. |
@mojavelinux I can't reproduce your npm issue...
If there are platform discrepancies then we should definitely file an upstream bug. |
The command doesn't fail. But it does show the following error:
That's why I suggest adding (I installed Node using nvm and I'm now using npm 6.4.1). Btw, yarn doesn't have this problem, which is why I still prefer it. |
I just don't like the Here's the UX with npm 6.4.1 and (node v10.11.0): With
|
We're in total agreement that the questionnaire is ridiculous. And your comment verified that we're seeing the same results. So now we're in a place where we can advance the conversation. The question we need to ask ourselves is, what's the bare minimum that is needed in package.json to make npm happy? As it turns out, it's really simple.
With that in place, npm no longer complains. What do you think about adding this command in place of |
Yes, expect a PR soon with a little bash comment offering npm init as an
alternative.
Le mar. 16 oct. 2018 1 h 06 a.m., Dan Allen <notifications@github.com> a
écrit :
… We're in total agreement that the questionnaire is ridiculous. And your
comment verified that we're seeing the same results. So now we're in a
place where we can advance the conversation.
The question we need to ask ourselves is, what's the bare minimum that is
needed in package.json to make npm happy? As it turns out, it's really
simple.
echo {} > package.json
With that in place, npm no longer complains. What do you think about
adding this command in place of npm init?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#141 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAhWFV7i-5_8iD7lXwTBpkUeh5ulFa_Tks5ulWlVgaJpZM4PbETI>
.
|
I have done it here while resolving the conflict instead. Merging as soon as Travis tests passes. |
Add instructions to the npm installation section. Create a new folder for slides and then do npm init in that folder. If slides are stored away from the directory where 'node_modules' exists, then there will be an error when attempting to generate slides from a file not found issue.