CLI error on Mac

Recently I updated my npm from 6.14.15 to 8.3.2, now every time I run ‘npm run dev’ I get the following error: ‘Error: This package is deprecated and no longer functional. Learn how to migrate to the new CLI’.

I’ve also done a doppler update and everything is already up to date. The current version of Doppler 3.37.0.

I went through the steps but I already have doppler all set up.

Not sure what else to do.

Hi @Jose_Perez!

Sorry that you’re having trouble here!

Could you post what you have set for the dev script in your package.json? Could you also add a new script that simply runs doppler --version and post what it displays when you run it via npm run?

Thanks,
-Joel

Hi @watsonian ,

For the dev script I have “dev”: “doppler run – node server.js --inspect”. I am currently running my server by using that script instead of npm run dev.

The new script that you want me to add doppler --version, any specific way to add it?

Thanks

You should be able to just add a new entry in the scripts hash in your package.json. You can call the key whatever you like and make the value doppler --version. For example:

"scripts": {
    ...
    "doppler-version": "doppler --version", 
    ...
},

Note that I’m just using ... above as a placeholder for whatever other content is already there. Once you’ve added the above line, you should be able to run npm run doppler-version.

I get the same error as running npm run dev, ‘Error: This package is deprecated and no longer functional. Learn how to migrate to the new CLI’.

@watsonian I also have Storybook and if I run the npm run storybook command it works fine. But if I want to run npm run test I get the same error as running npm run dev.

Could you try changing that new script command to which doppler rather than doppler --version? It should give you the path to the Doppler CLI binary being executed. Once you have that, try running that binary (using the full path) with the --version flag:

/full/path/to/doppler --version

Then just run which doppler outside of npm and compare the paths. It seems like there are two separate copies of the Doppler CLI installed and one of them is up-to-date and the other (which is the one npm is using) isn’t.

This is what I got after running the ‘which doppler’,

If I have two files/versions what or how can I fix this?

If it’s best, is there a way to jump on a Google meet/Zoom chat?

Okay, it looks like you’re using a deprecated doppler-cli npm package that’s no longer maintained. If you remove that from your project dependencies, then it should use the system Doppler CLI and you should get back into a good state!

Thank you @watsonian! I am all set and running again!