Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error An unexpected error occurred: "EEXIST: file already exists" #8079

Closed
markolofsen opened this issue Apr 24, 2020 · 6 comments
Closed

error An unexpected error occurred: "EEXIST: file already exists" #8079

markolofsen opened this issue Apr 24, 2020 · 6 comments

Comments

@markolofsen
Copy link

#7710 # Bug description
When I tried make yarn install I got error. The problem related with workspaces how I understand now. Before that everything was ok.

Command

yarn install

What is the current behavior?

error An unexpected error occurred: "EEXIST: file already exists, mkdir '/home/admin/web/domain.com/node_modules/nextjs'".

What is the expected behavior?
All packages have to be installed

Steps to Reproduce

Yarn version: 
  1.17.3

Node version: 
  10.15.3

Platform: 
  linux x64

Trace: 
  Error: EEXIST: file already exists, mkdir '/home/admin/web/domain.com/node_modules/nextjs'

npm manifest: 
  {
    "name": "nextjs",
    "version": "4.0.0",
    "private": true,
    "scripts": {
      "dev": "node server/index.js",
      "build": "rm -rf .next* && next build && zip -r .next.zip .next",
      "export": "next build && next export",
      "start": "NODE_ENV=production node server/index.js",
      "startDev": "next build && cross-env NODE_ENV=development node server/index.js",
      "startProd": "next build && cross-env NODE_ENV=production node server/index.js",
      "lint": "standard --fix",
      "storybook": "start-storybook -s ./public -p 6006",
      "build-storybook": "build-storybook",
      "analyze": "BUNDLE_ANALYZE=both next build",
      "analyze:server": "BUNDLE_ANALYZE=server next build",
      "analyze:browser": "BUNDLE_ANALYZE=browser next build"
    },
    "engines": {
      "npm": ">=6.1.0",
      "node": ">=10.15.3"
    },
    "workspaces": {
      "packages": [
        ".storybook/**/**",
        "components/**/**",
        "api/**/**",
        "pages/**/**"
      ],
      "nohoist": []
    },
    "browserslist": [
      "> 1%",
      "ie >= 8",
      "edge >= 15",
      "ie_mob >= 10",
      "ff >= 45",
      "chrome >= 45",
      "safari >= 7",
      "opera >= 23",
      "ios >= 7",
      "android >= 4",
      "bb >= 10"
    ],
    "dependencies": {
      "@material-ui/core": "^4.9.1",
      "@material-ui/icons": "^4.9.1",
      "@material-ui/lab": "^4.0.0-alpha.45",
      "@zeit/next-css": "1.0.1",
      "classnames": "^2.2.6",
      "clsx": "latest",
      "color": "^3.1.2",
      "express": "^4.16.4",
      "mobx": "^5.15.4",
      "mobx-react": "^6.1.7",
      "mobx-sync": "^2.1.2",
      "moment": "^2.24.0",
      "next": "9.2.2-canary.21",
      "next-i18next": "^4.2.0",
      "next-routes": "^1.4.2",
      "nprogress": "^0.2.0",
      "prop-types": "latest",
      "react": "latest",
      "react-device-detect": "^1.11.14",
      "react-dom": "latest",
      "react-ga": "^2.7.0",
      "react-helmet": "^5.2.1"
    },
    "resolutions": {},
    "devDependencies": {
      "@babel/core": "^7.8.4",
      "@babel/plugin-proposal-class-properties": "^7.1.0",
      "@babel/plugin-proposal-decorators": "^7.1.0",
      "@zeit/next-bundle-analyzer": "^0.1.2",
      "babel-eslint": "11.0.0-beta.2",
      "babel-loader": "^8.0.6",
      "babel-plugin-inline-react-svg": "^1.1.1",
      "babel-plugin-root-import": "^6.4.1",
      "babel-plugin-styled-components": "^1.10.7",
      "core-js": "2.6.5",
      "cross-env": "5.2.0",
      "eslint": "5.16.0",
      "eslint-config-standard": "12.0.0",
      "eslint-config-standard-jsx": "6.0.2",
      "eslint-plugin-import": "2.17.3",
      "eslint-plugin-node": "9.1.0",
      "eslint-plugin-promise": "4.1.1",
      "eslint-plugin-react": "7.13.0",
      "eslint-plugin-standard": "4.0.0",
      "openurl": "^1.1.1"
    }
  }
@garbinmarcelo
Copy link

any news?

@markolofsen
Copy link
Author

Yes, don't make symlink to the .node_modules, it should be directory only.

@diasrodinei
Copy link

If that directory (node_modules) is mapped by Google Drive, it use to create something like a simlink and that happens. Just move it to a directory that is not observed by any sync tool and it's sorted out.

jgehrcke added a commit to opstrace/opstrace that referenced this issue Aug 11, 2021
Got this during yarn

An unexpected error occurred: "EEXIST: file already exists,

found
yarnpkg/yarn#8079 (comment)

Signed-off-by: Dr. Jan-Philip Gehrcke <jp@opstrace.com>
jgehrcke added a commit to opstrace/opstrace that referenced this issue Aug 11, 2021
Got this during yarn

An unexpected error occurred: "EEXIST: file already exists,

found
yarnpkg/yarn#8079 (comment)

Signed-off-by: Dr. Jan-Philip Gehrcke <jp@opstrace.com>
jgehrcke added a commit to opstrace/opstrace that referenced this issue Aug 11, 2021
during preamble:

 error An unexpected error occurred: "EACCES: permission denied, unlink \
  '/build/node_modules/.yarn-integrity'".

Signed-off-by: Dr. Jan-Philip Gehrcke <jp@opstrace.com>

ci: container: non-root /node_modules

Got this with the chmod -R technique:

[2021-08-11T14:10:14Z] error An unexpected error occurred:
    "EPERM: operation not permitted, chmod '/node_modules/@babel
    /core/node_modules/
    @babel/generator/node_modules/.bin/jsesc'".

Signed-off-by: Dr. Jan-Philip Gehrcke <jp@opstrace.com>

ci: preamble: copy /node_modules

Got this during yarn

An unexpected error occurred: "EEXIST: file already exists,

found
yarnpkg/yarn#8079 (comment)

Signed-off-by: Dr. Jan-Philip Gehrcke <jp@opstrace.com>
jgehrcke added a commit to opstrace/opstrace that referenced this issue Aug 11, 2021
during preamble:

 error An unexpected error occurred: "EACCES: permission denied, unlink \
  '/build/node_modules/.yarn-integrity'".

Signed-off-by: Dr. Jan-Philip Gehrcke <jp@opstrace.com>

ci: container: non-root /node_modules

Got this with the chmod -R technique:

[2021-08-11T14:10:14Z] error An unexpected error occurred:
    "EPERM: operation not permitted, chmod '/node_modules/@babel
    /core/node_modules/
    @babel/generator/node_modules/.bin/jsesc'".

Signed-off-by: Dr. Jan-Philip Gehrcke <jp@opstrace.com>

ci: preamble: copy /node_modules

Got this during yarn

An unexpected error occurred: "EEXIST: file already exists,

found
yarnpkg/yarn#8079 (comment)

Signed-off-by: Dr. Jan-Philip Gehrcke <jp@opstrace.com>
jgehrcke added a commit to opstrace/opstrace that referenced this issue Aug 12, 2021
during preamble:

 error An unexpected error occurred: "EACCES: permission denied, unlink \
  '/build/node_modules/.yarn-integrity'".

Signed-off-by: Dr. Jan-Philip Gehrcke <jp@opstrace.com>

ci: container: non-root /node_modules

Got this with the chmod -R technique:

[2021-08-11T14:10:14Z] error An unexpected error occurred:
    "EPERM: operation not permitted, chmod '/node_modules/@babel
    /core/node_modules/
    @babel/generator/node_modules/.bin/jsesc'".

Signed-off-by: Dr. Jan-Philip Gehrcke <jp@opstrace.com>

ci: preamble: copy /node_modules

Got this during yarn

An unexpected error occurred: "EEXIST: file already exists,

found
yarnpkg/yarn#8079 (comment)

Signed-off-by: Dr. Jan-Philip Gehrcke <jp@opstrace.com>
@davidcox67
Copy link

rebuild

@alephpt
Copy link

alephpt commented Mar 26, 2024

none of these answers helped

@amitgupta6
Copy link

Remove build directory rm -rf .build (or wherever is your build directory) and do yarn or yarn install again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants