Error: ENOENT: no such file or directory when using npm to build the project

Viewed 599

when I using this command to build my project in macOS calalina(Intel Chip):

npm run build

shows error like this:

⠦  Building for production...

 ERROR  Failed to compile with 2 errors                                                                                               11:15:12

 error  in ./src/components/FeatherIcon.vue?vue&type=style&index=0&lang=scss&

Error: ENOENT: no such file or directory, scandir '/Users/dabaidabai/.jenkins/workspace/be-zhuolian-org-frontend-fat/node_modules/node-sass/vendor'


 @ ./src/components/FeatherIcon.vue?vue&type=style&index=0&lang=scss& 1:0-506 1:0-506
 @ ./src/components/FeatherIcon.vue
 @ ./src/globalComponents.js
 @ ./src/main.js
 @ multi ./src/main.js

 error  in ./src/assets/scss/vuexy/extraComponents/agGridStyleOverride.scss

Error: ENOENT: no such file or directory, scandir '/Users/dabaidabai/.jenkins/workspace/be-zhuolian-org-frontend-fat/node_modules/node-sass/vendor'


 @ ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/views/zlpages/activepage/index.vue?vue&type=script&lang=js& 224:0-70
 @ ./src/views/zlpages/activepage/index.vue?vue&type=script&lang=js&
 @ ./src/views/zlpages/activepage/index.vue
 @ ./src/router.js
 @ ./src/main.js
 @ multi ./src/main.js

 ERROR  Build failed with errors.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vuexy-vuejs-html-laravel-dashboard-admin-template@4.0.0 build: `vue-cli-service build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vuexy-vuejs-html-laravel-dashboard-admin-template@4.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/dabaidabai/.npm/_logs/2021-12-15T03_15_12_736Z-debug.log

I have tried to use this command:

npm install

and this command execute success. what should I do to fix this problem? this is the package.json file of my project:

{
  "name": "vuexy-vuejs-html-laravel-dashboard-admin-template",
  "version": "4.0.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint"
  },
  "dependencies": {
    "@chenfengyuan/vue-countdown": "^1.1.2",
    "ag-grid-community": "^21.0.1",
    "ag-grid-vue": "^21.0.1",
    "algoliasearch": "^3.33.0",
    "apexcharts": "^3.6.12",
    "auth0-js": "^9.10.4",
    "axios": "^0.19.0",
    "chart.js": "^2.8.0",
    "core-js": "2.6.5",
    "echarts": "^4.2.1",
    "element-ui": "^2.15.6",
    "file-saver": "2.0.1",
    "firebase": "7.13.2",
    "instantsearch.css": "^7.3.1",
    "jsonwebtoken": "^8.5.1",
    "material-icons": "^0.3.1",
    "perfect-scrollbar": "^1.4.0",
    "postcss-rtl": "^1.5.0",
    "prismjs": "^1.16.0",
    "vee-validate": "^2.2.8",
    "vue": "^2.6.10",
    "vue-acl": "4.0.7",
    "vue-apexcharts": "^1.3.5",
    "vue-awesome-swiper": "^3.1.3",
    "vue-backtotop": "^1.6.1",
    "vue-chartjs": "^3.4.2",
    "vue-clipboard2": "^0.3.0",
    "vue-context": "4.0.0",
    "vue-echarts": "^4.0.3",
    "vue-feather-icons": "^5.0.0",
    "vue-flatpickr-component": "^8.1.2",
    "vue-form-wizard": "^0.8.4",
    "vue-fullcalendar": "^1.0.9",
    "vue-i18n": "^8.11.2",
    "vue-instantsearch": "^2.2.1",
    "vue-perfect-scrollbar": "^0.1.0",
    "vue-prism-component": "^1.1.1",
    "vue-property-decorator": "^8.1.1",
    "vue-quill-editor": "^3.0.6",
    "vue-router": "^3.0.6",
    "vue-select": "^3.1.0",
    "vue-simple-calendar": "^4.2.2",
    "vue-simple-suggest": "^1.9.5",
    "vue-star-rating": "^1.6.1",
    "vue-tour": "^1.1.0",
    "vue-tree-halower": "^1.8.0",
    "vue-video-player": "^5.0.2",
    "vue2-google-maps": "^0.10.6",
    "vue2-hammer": "^2.1.2",
    "vuedraggable": "^2.21.0",
    "vuejs-datepicker": "^1.5.4",
    "vuesax": "jd-0001/vuesax",
    "vuex": "^3.1.1",
    "xlsx": "^0.15.0"
  },
  "devDependencies": {
    "@fullhuman/postcss-purgecss": "^1.2.0",
    "@vue/cli-plugin-babel": "^3.7.0",
    "@vue/cli-plugin-eslint": "^3.7.0",
    "@vue/cli-service": "^3.7.0",
    "axios-mock-adapter": "^1.17.0",
    "babel-plugin-component": "^1.1.1",
    "dayjs": "^1.10.7",
    "node-sass": "^4.12.0",
    "purgecss": "^1.3.0",
    "sass-loader": "^7.1.0",
    "script-loader": "0.7.2",
    "tailwindcss": "^1.0.1",
    "vue-template-compiler": "^2.6.10"
  }
}

my node version is 15.14.0. npm version is 6.4.1.

0 Answers
Related