Open TitaneBoy opened 7 years ago
hi, I'll fix the shields issue in a few minutes
you have to have mos installed in your project as a dev dep. If so, update it, I published a fix to mos-plugin-shields
. Use npm update --depth 100
Hi @zkochan . Thanks a lot for your quick answer..
I'm not sure but I think that your fix is not yet publish to npm..The last release of mos in npm is about a year ago.. Am I wrong ?
it is a subdeps of mos that was fixed. A deep update will load the new, fixed package
Well...I've uninstalled and installed again mos in my project...I guess that should get the last version of "mos"... I'm not sure but I think that uninstalling and installing again the module is kind of.."deep update", right ? Or may be I'm missing something..?
ok, so the error is not gone?
The last version of mos, after installing it, is 1.3.1 and is dated to 2016-06-14.. So, I don't think that the last version of mos, with the fix, is yet published in npm..
With the version 1.3.1 of mos, when installed locally, with templating syntax in readme.md (as described in my first post), and when executing the "mos" command, I got this error:
C:\Test\Express\MyApp>node_modules\.bin\mos
Error: Failed to register mos-plugin-shields. Error: The shields plugin only works for github repos
at wrapError (C:\Test\Express\MyApp\node_modules\remi\dist\index.js:38:24)
at C:\Test\Express\MyApp\node_modules\remi\dist\index.js:46:26
at <anonymous>
Note: I've installed locally "mos" and "mos-plugin-package-json"
The error was in mos-plugin-shields
which is a dependency of mos. There is no need to publish a new version of mos. I published mos-plugin-shields@2.2.3
with the fix. When reinstalling mos, it will have the fixed dependency
Well...I'm sorry...My bad...You're right...
The first error described in this issue is gone... But as I said, when I'm executing "mos" in the root directory, I have the
"Failed to register mos-plugin-shields. Error: The shields plugin only works for github repos"
error as described earlier... Can you tell me please what I'm doing wrong or what I am missing ?
But that's the error I was trying to fix
Could you run npm list mos-plugin-shields --depth 10
to check what version of mos-plugin-shields you have installed?
Sure...This is what I got:
C:\Test\Express\MyApp>npm list mos-plugin-shields --depth 10
myproject@1.0.19 C:\Test\Express\MyApp
`-- mos@1.3.1
`-- mos-plugin-shields@2.2.0
So weird, the latest version of mos-plugin-shields
is 2.2.3, so that one should have been installed. Do you have a package-lock.json
or yarn.lock
? Maybe they locked the version of mos-plugin-shields
Well..I'm using yarn and What I decided to do, is to remove completely node_modules and yarn.lock. So I've installed again my modules...but there is no way to upgrade with yarn the mos-plugin-shields related to mos... Because when I'm doing the following command
yarn upgrade mos-plugin-shields
, it will add a new mos-plugin-shields module but the mos module will continue to use the old one (2.2.0) instead of the 2.2.3. There is no --depth option available for upgrading modules with yarn (yarn upgrade). So I guess that the best way should to update the package.json of the mos project to put the new version of the mos-plugin-shields module
For now, I've decided to cheat a little bit and I've replaced manually the mos-plugin-shields folder in node_nodules so mos could use the new version of it.
It looks there is no error.. But I see other issue..
For example, in my readme.md file, I had stuff writted in the ## Installation section but after the "mos" command, it disappears completely.
And the last, I put the following in my readme.md file:
< !--@'# ' + pkg.name-->
< !--/@-->
(Note: I put a dot (.) near the "#" so it could be seen in github. Same for the space after the "<")
After the mos command, there is no packages and versions in the readme.md file. The my-awesome-module is replaced with the name of my project (set in package.json) and that's all. Do you know what I'm doing wrong ?
Thank you in advance for your help and answer
of course, sorry this package is a bit unmaintained because I spend all my time on pnpm.
Maybe try to write the header as in the usage example: https://github.com/mosjs/mos#usage
I don't know why the ## Installation
section disappeared, does appear again on next generation? It should be generated automatically from info that is in package.json
I forgot to mention that For the ## Installation
section, My stuff disappears but is replaced with:
```sh npm install --save my_project_name ``` Where my_project_name is the name of the project defined in package.json. On each generation, still have the same thing as described above
I've put the header as in the usage example but had the same behavior: It will only write between the two <!-- the name of the projected defined in package.json
all seems correct. h1([pkg.name])
adds the # project_name
. If you want the project version there, you have to write something like h1([pkg.name + '@' + pkg.version])
.
The installation section is automatically replaced as of mos v1. You can install mos@next
if you don't want that.
Thank you...but what I must do to have package version...I mean...dependencies and their versions, in the markdown file ?
I just don't understand/know the syntax to use for that...
Well..thanks for the info...And how to get versions value of these dependencies ?
It will create sections like this. It only prints the names of packages, no versions.
If you really need versions there, you can update mos-plugin-dependencies with an option that will make it print names + versions. Or you can fork it and create your custom plugin
Hello @zkochan, can you please change the dependencies versions in mos/package.json so that it takes the last versions of plugins (not a static one) like using ^. Thanks And thank you for this awesome project :)
Hi.. I'm trying to use your modules but got the error described in the title. I've installed mos globally with npm and in my project, I've tried to use
mos --init
. I got the following error:I've installed locally the mos-plugin-package-json package to be able to print packages and their version in the md file but when executing the
mos
command, I got another error:For the package-json package, in my markdown file, I've put the following inside the file:
< !--@'# ' + pkg.name-->
my-awesome-module
< !--/@-->
But as I said, I had the "Failed to register mos-plugin-shileds" error.
Can you help me please ?
Thank you