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

Errors during npm install #16

Open
miro-ux opened this issue Feb 24, 2023 · 0 comments
Open

Errors during npm install #16

miro-ux opened this issue Feb 24, 2023 · 0 comments

Comments

@miro-ux
Copy link

miro-ux commented Feb 24, 2023

Just wanted to share some issues that I encountered and how to fix them:

Out of the box, running npm install resulted in same error as in this issue

What @abhimanusharma recommended worked:

  1. Run npm i -g npm
  2. delete package-lock.json file
  3. delete node_modules folder
  4. Run npm cache clean --force
  5. Run npm cache verify
  6. Run npm install

Despite installing, it was still throwing an error:

npm ERR! code 1
npm ERR! path ...\vue-formbuilder\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node scripts/build.js

Tried to run npm run serve anyway but got:

 ERROR  Failed to compile with 1 error
 error  in ./src/assets/scss/main.scss

Syntax Error: Error: Node Sass version 8.0.0 is incompatible with ^4.0.0.

Removing the deprecated node-sass and replacing it with sass did the trick:

npm uninstall node-sass
npm install sass

Finally on NodeJS 16+ it will throw yet another error (about SSL, unrelated to this package):

  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'

Was able to resolve by modifying the script commands in package.json:

  "scripts": {
    "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
    "build": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
    "lint": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service lint"
  },

(Use EXPORT instead of SET on Linux)

Runs great now!

Hope this helps someone.
Thanks!

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

1 participant