Error when executing something at datocms cli

My version:

datocms --help            
CLI to interact with DatoCMS APIs

  @datocms/cli/1.0.20 darwin-arm64 node-v17.9.1

When running datocms migrations:new 'create article model'
the following error occurs:

datocms migrations:new 'create article model'
 ›   ModuleLoadError: [MODULE_NOT_FOUND] require failed to load /Users/my-user/.nvm/versions/node/v17.9.1/lib/node_modules/@datocms/cli/lib/commands/migrations/new.js: Cannot find module 
 ›   '/Users/my-user/.nvm/versions/node/v17.9.1/lib/node_modules/@datocms/cli/node_modules/browser-or-node/lib/index.js'. Please verify that the package.json has a valid "main" entry

Indeed, I dont see browser-or-node as a dependency in the package.json of datocms@cli

after deleting datocms cli from node_modules and reinstalling, problem was gone

1 Like