Need help with npm

Saudnya Mahajan (INFOSYS LIMITED) 20 Reputation points Microsoft External Staff
2025-10-28T13:45:10.99+00:00

Need help with below scenario

In our project we have enabled pnpm.

when I hit the command 'pnpm run test '

facing below error

ERR_PNPM_NO_IMPORTER_MANIFEST_FOUND  No package.json (or package.yaml, or package.json5) was found in "C:\Users<Username>\Project\SC.L2O.Mepla.Simple\automated-tests".

Developer technologies | Visual Studio | Testing
0 comments No comments
{count} votes

Answer accepted by question author
  1. Adiba Khan 1,440 Reputation points Microsoft External Staff
    2025-10-30T10:14:08.7333333+00:00

    Thanks for reaching out. The error indicates that PNPM Is unable to locate a manifest file(package.JSON , package.yaml, or package.json5) in the directory where the command is being executed. PNPM requires one of these files to understand the project's dependencies and scripts.

    Steps to resolve

    1.      check for the package.json file

    ·         Navigate to your project folder and confirm if a package.json file exists.

    ·         Example:

               Cd  C:\Users\<Username>\Project\SCL2.0.Mepla.Simple\automated-tests dir package.json
    

    ·         If not found, navigate to the folder that actually contains your package.json (for example the project root).

    2.      Run the command from the correct directory

    ·         Ensure you are running the command in the same folder that contains your package.json

                Cd  C:\Users\<Username>\Project\SCL2.0.Mepla.Simple pnpm run test
    

    3.      if package.json is missing

    ·         You can recreate it using:

    Pnpm init

    ·         This will guide you to create a new manifest file for your project.

    4.      Check workspace setup(if using monorepo)

    ·         If your project uses PNPM workspaces ensure that

                                                                  i.      you have a pnpm-workspace.yaml at the root.

                                                                ii.      The package filled in it correctly includes your subfolder(e.g., automated-tests)

    ·         Example:

                    Packages:
    
                        -          ‘automated-tests/*’
    

    5.       Reinstall dependencies

    ·         After consuming the correct folder and manifest:

                   Pnpn install
    
                   Pnpm run test
    

    Additional References

    ·         Manage npm packages for Node.js and ASP.NET Core projects - Visual Studio (Windows) | Microsoft Learn

    If the issue persists after these steps, please share:

    ·         The folder structure of your project

    ·         The output of pnpm list

    ·         The location of your packagejso and pnpm-workspace.yaml files.

     

     Please let us know if you require any further assistance we’re happy to help. If you found this information useful, kindly mark this as "Accept Answer".


1 additional answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 81,981 Reputation points Volunteer Moderator
    2025-10-28T15:16:49.3133333+00:00

    the error says you did not create a configuration file (typically package.json). Be sure the scripts section has a test entry. You can create one with

    npm create
    

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.