Bold Init: Does not have a script named "command"
| Title | Description |
|---|---|
| Version | 0.22.5 |
| Type | Issue |
| node | 10 |
| Operating System | MacOs Mojave |
| Short Description | Create a new folder and typed npm init -y then bolt init and I get Package at "path-to-folder" does not have a script named "command" |
| Detailed description | It is meant to actually initialise the bolt instance |
Actually, the problem happens with every bolt command I run
Hiya, you don't need to run bolt init, that's just to run yarn init and probably isn't implemented.
Have you added the workspaces field to your package.json?
Yeah I have workspace in the package.json but if I should run any bolt command I would defined get same error.
Hey @Quadriphobs1 , Can you create a minimum reproducible example? That will defiantly help us understand the issue better, 🙂
No matter what command I run, even bolt help
So I had to do some digging to this, I cloned the repo local and remove the bolt i have locally already, then I link the cloned bolt version, and in the folder I will be using the bolt I had to link it using yarn link bolt which would install the bolt version to the package.json by running the bolt init it works by showing the yarn init walkthrough
Also creating another example and just install bolt as part of the dev-deps works as fine by running yarn bolt --command--
Can you link a repo that we can test in?
Fyi, you also don't need to bolt init, that's just an alias for yarn init.
@Quadriphobs1 So, if I have got it correct. Issue was with the bolt that you had globally installed. Does reinstalling it( instead of linking the local repo ) resolve the issue?
Try:
yarn global remove bolt
yarn global add bolt
No it doesn't, instead I installed bolt as a devDeps and use yarn to run a the bolt command like yarn bolt command
@Quadriphobs1 Globally installed bolt should work fine. I am using it in multiple projects.
Do you mind pushing your repository code so that I can clone it in local and test. Also, please post the version of yarn that you are using.
If you feel comfortable we can share screen and thus I can help you debug the issue. 🙂
@ajaymathur I faced a similar issue while running any bolt p run command. I believe this was something that was fixed recently with
https://github.com/boltpkg/bolt/pull/210
This issue makes the bolt p run series of commands practically unusable anywhere where one relies on the status code of the executed command. It looks like it might be related to this issue as well. Considering the impact, can this fix be released on npm?
@pastelsky , I don't think they're related at all but I've released that change in 0.22.6. That should fix your bolt p problems.
This issue looks to be something wrong with the users global installation but the user isn't replying to we can't replicate anywhere. I installed the same version of bolt and node and can't replicate (you shouldn't every be able to see a message that says does not have a script named "command" unless you literally ran
bolt command
bolt w command
bolt ws command
bolt p command
Otherwise, it would have to say the name of the command it was running.