Hi Idk whats happened with mops packages recently but its bugging out my VS Code. I have made sure everything is up to date but get this error and then failures to import any mops packages in my vs code
Error while resolving Motoko packages: Error while running defaults.build.packtool
in dfx.json
config file: Command failed: mops sources /bin/sh: mops: command not found
my code runs fine but just get annoying vs code syntax highlighting
if i run mops sources from my command line it works perfectly fine
did you install by npm?
if yes try change mops source
to npx ic-mops sources
I had this issue yesterday:
Error while resolving Motoko packages: Error while running defaults.build.packtool in dfx.json config file: Command failed: mops sources /bin/sh: mops: command not found
and resolved it by changing my config’d shell to zsh and restarting…I also noticed that it seems my code plugin runs faster which is interesting.
check VSCode Shell Configuration
Ensure that VSCode is using the same shell as your terminal:
- Go to Settings in VSCode.
- Search for “terminal.integrated.shell.osx” (or the relevant OS you’re using).
- Make sure it points to the same shell you use in your terminal (
/bin/bash
, /bin/zsh
, etc.).