bolt icon indicating copy to clipboard operation
bolt copied to clipboard

Bold Init: Does not have a script named "command"

Open Quadriphobs1 opened this issue 6 years ago • 13 comments

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

Quadriphobs1 avatar Dec 21 '18 16:12 Quadriphobs1

Actually, the problem happens with every bolt command I run

Quadriphobs1 avatar Dec 21 '18 16:12 Quadriphobs1

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?

lukebatchelor avatar Dec 22 '18 00:12 lukebatchelor

Yeah I have workspace in the package.json but if I should run any bolt command I would defined get same error.

Quadriphobs1 avatar Dec 22 '18 07:12 Quadriphobs1

Hey @Quadriphobs1 , Can you create a minimum reproducible example? That will defiantly help us understand the issue better, 🙂

ajaymathur avatar Dec 22 '18 08:12 ajaymathur

screenshot 2018-12-24 at 06 55 39

No matter what command I run, even bolt help

Quadriphobs1 avatar Dec 24 '18 05:12 Quadriphobs1

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

Quadriphobs1 avatar Dec 24 '18 06:12 Quadriphobs1

Also creating another example and just install bolt as part of the dev-deps works as fine by running yarn bolt --command--

Quadriphobs1 avatar Dec 24 '18 06:12 Quadriphobs1

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.

lukebatchelor avatar Dec 24 '18 10:12 lukebatchelor

@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

ajaymathur avatar Dec 25 '18 06:12 ajaymathur

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 avatar Dec 25 '18 06:12 Quadriphobs1

@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 avatar Dec 25 '18 08:12 ajaymathur

@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 avatar Dec 30 '18 10:12 pastelsky

@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.

lukebatchelor avatar Jan 03 '19 02:01 lukebatchelor