Home > database >  ENOENT: No such file or directory ..\node_modules\.staging\@types\react-transition-group-96871f1
ENOENT: No such file or directory ..\node_modules\.staging\@types\react-transition-group-96871f1

Time:10-11

I'm trying to run a React project in VS2013. I had followed Nuke

Alot of the solutions I've seen on StackOverflow state to delete node_modules and package-lock.json and then try to reinstall. For some reason my project doesn't have package-lock.json but it doesn't resolve the issue when I delete node_modules and try to reinstall. I've also tried to clear the cache with npm cache clean --force but it didn't make a difference either.

Package.JSON

{
  "name": "ProjectName",
  "version": "0.0.0",
  "description": "ProjectDescription",
  "main": "server.js",
  "author": {
    "name": "",
    "email": ""
  },
  "dependencies": {
    "@popperjs/core": "^2.11.6",
    "@types/react-transition-group": "4.4.5",
    "react-transition-group": "4.4.5",
    "bootstrap": "^5.2.2",
    "braces": "^2.3.1",
    "express": "~4.17.1",
    "path": "~0.12.7",
    "react-bootstrap": "^2.4.0",
    "react": "^18.0.0",
    "react-dom": "^18.0.0",
    "ts-loader": "~7.0.1",
    "typescript": "~3.8.3",
    "webpack": "~4.42.1",
    "webpack-cli": "~3.3.11"
  },
  "scripts": {
    "build": "webpack-cli ./app.tsx --config webpack-config.js"
  }
}

Error Message when using npm install Error Message

EDIT 1

I just found this link which shows that you should be able to search for the package in the npm installer in vs2013, however when I search for react-bootstrap it can't seem to find the package.

On a side note, every time I restart my computer I have to follow this to be able to use Nuget Package Manager otherwise it just gets stuck on Retrieving Information...

Could this possibly be related?

I've always used cmd to npm install the packages and when following the Microsoft tutorial above I didn't have an issue with installing the packages.

EDIT 2

I get a similar issue when trying to npm install @types/react

I've done a bit more research and went through the entire list of dependencies for react-bootstrap:

- @babel/runtime
    - regenerator-runtime
- @restart/hooks
    - dequal
- @restart/ui
    - @babel/runtime
        - regenerator-runtime
    - @popperjs/core
    - @react-aria/ssr
        - @babel/runtime
            - regenerator-runtime
    - @restart/hooks
        - dequal
    - @types/warning
    - dequal
    - dom-helpers
        - @babel/runtime
            - regenerator-runtime
        - csstype
    - uncontrollable
        - @babel/runtime
            - regenerator-runtime
        - @types/react
            - @types/prop-types
            - @types/scheduler
            - csstype
        - invariant
            - loose-envify
                - js-tokens
        - react-lifecycles-compat
    - warning
        - loose-envify
            - js-tokens
- @types/react-transition-group
    - @types/react
        - @types/prop-types
        - @types/scheduler
        - csstype
- classnames
- dom-helpers
    - @babel/runtime
        - regenerator-runtime
    - csstype
- invariant
    - loose-envify
    - js-tokens
- prop-types
    - loose-envify
        - js-tokens
    - object-assign
    - react-is
- prop-types-extra
    - react-is
    - warning
        - loose-envify
            - js-tokens
-react-transition-group
    - @babel/runtime
        - regenerator-runtime
    - dom-helpers
        - @babel/runtime
            - regenerator-runtime
        - csstype
    - loose-envify
            - js-tokens
    - prop-types
        - loose-envify
            - js-tokens
        - object-assign
        - react-is
- uncontrollable
    - @babel/runtime
        - regenerator-runtime
    - @types/react
        - @types/prop-types
        - @types/scheduler
        - csstype
    - invariant
        - loose-envify
            - js-tokens
    - react-lifecycles-compat
- warning
    - loose-envify
        - js-tokens

I had decided to try to install them in the order below. I would start with one parent and install all it's children before installing the parent. I had deleted node_modules folder before starting and had noticed I was getting errors about not having react 18.0.0 so I had installed that first.

npm i [email protected]
npm i regenerator-runtime
npm i @babel/runtime
npm i dequal
npm i @restart/hooks
npm i @popperjs/core
npm i @react-aria/ssr
npm i @types/warning
npm i csstype
npm i dom-helpers
npm i @types/prop-types
npm i @types/scheduler
npm i @types/react
npm i js-tokens
npm i loose-envify
npm i invariant
npm i react-lifecycles-compat
npm i uncontrollable
npm i warning
npm i @restart/ui
npm i @types/react-transition-group
npm i classnames
npm i object-assign
npm i react-is
npm i prop-types
npm i prop-types-extra
npm i react-transition-group
npm i uncontrollable

When I had got around to npm i @types/react I got a similar warning to the one above for react-bootstrap. It was complaining about not being able to find the package.json file for it in 'C:\Users\...\node_modules\.staging\@types\react-213996eb\package.json'.

CodePudding user response:

Followed Michael's comment and used pnpm which provided more detail about the issue. Turns out there was some other packages missing. pnpm does require a later version of node.js so I had to upgrade the older version I had.

  • Related