3

So this company gave me the assignment to build a simple Vue app. I forked code from their repo and tried to run npm install. But It gave me couple errors that is in this log file. Also here is my package.json file:

{
  "name": "todo-app",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "test:unit": "vue-cli-service test:unit",
    "lint": "vue-cli-service lint"
  },
  "dependencies": {
    "axios": "^0.21.1",
    "core-js": "^3.6.5",
    "vue": "^3.0.0",
    "vue-router": "^4.0.0-0",
    "vuex": "^4.0.0-0"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "~4.5.0",
    "@vue/cli-plugin-eslint": "~4.5.0",
    "@vue/cli-plugin-router": "~4.5.0",
    "@vue/cli-plugin-unit-jest": "~4.5.0",
    "@vue/cli-plugin-vuex": "~4.5.0",
    "@vue/cli-service": "~4.5.0",
    "@vue/compiler-sfc": "^3.0.0",
    "@vue/test-utils": "^2.0.0-0",
    "autoprefixer": "^9.8.6",
    "babel-eslint": "^10.1.0",
    "eslint": "^6.7.2",
    "eslint-plugin-vue": "^7.0.0",
    "jest-transform-stub": "^2.0.0",
    "node-sass": "^4.12.0",
    "postcss": "^7.0.36",
    "sass-loader": "^8.0.2",
    "tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.2.7",
    "typescript": "~3.9.3",
    "vue-jest": "^5.0.0-0"
  }
}

Here are couple extra information if those are necessary:

  • npm version : 7.21.1
  • @vue/cli version : 4.5.13
  • Node version : 16.0.0

Part of error

5827 verbose stack Error: command failed
5827 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27)
5827 verbose stack     at ChildProcess.emit (node:events:365:28)
5827 verbose stack     at maybeClose (node:internal/child_process:1067:16)
5827 verbose stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
5828 verbose pkgid [email protected]
5829 verbose cwd /home/yarkin/Documents/WEB/VueJS/todo-app
5830 verbose Linux 5.11.0-37-generic
5831 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--saveDev" "[email protected]"
5832 verbose node v16.0.0
5833 verbose npm  v7.21.1
5834 error code 1
5835 error path /home/yarkin/Documents/WEB/VueJS/todo-app/node_modules/node-sass
5836 error command failed
5837 error command sh -c node scripts/build.js
5838 error Building: /usr/local/bin/node /home/yarkin/Documents/WEB/VueJS/todo-app/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
4
  • Please, specify Node version as it's relevant. Consider pasting excerpts of a log in the question that contain errors, it should make sense even if external link is not available Commented Oct 9, 2021 at 8:06
  • @EstusFlask yes you're right. Edited question. Commented Oct 9, 2021 at 8:25
  • It looks like nose-sass failed to build. Commented Oct 9, 2021 at 8:30
  • it seems node-sass install error stackoverflow.com/questions/45589179/… Commented Oct 9, 2021 at 8:43

1 Answer 1

3

The problem is specific to node-sass, in this project it seems to be the only binary dependency that depends on a platform and Node version.

There is a message that lock file version is old, this means that it was created with another version of NPM (v6), this can be is a possible source of problems due to differences in resolved dependencies.

As the documentation lists, different node-sass versions are linked to different Node versions, "node-sass": "^4.12.0" suggests that the project is supposed to run with Node v12, while v16 was used.

Possible solutions are:

  • Switch to Node v12 for this project (can be too old for other ones) and run as is

  • Switch to Node v14 (the latest LTS release, less problems in general) and update node-sass to ^4.14

  • Stay with Node v16 and update node-sass to ^6.0

  • Stay with Node v16, remove node-sass, instead add platform-independent sass, follow migration guidelines for Dart Sass if problems arise (primarily / syntax)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.