Skip to content

npm install fails every time now #115

Open
@IntelligentFunction

Description

@IntelligentFunction

Hi, I really don't know what's happened, but it was all running fine, I messed up the code and just recloned the repo to do a reset, and now npm fails. I'm completely lost. last time this happened, it was due to node-modules in the wrong folder, I currently have no folders marked "node_modules" anywhere on this computer now I've cleared the cache, but still I can't get any of the lessons to now work as node simply won't do it's job. here is the error message I am getting when I run npm install:
npm ERR! code 1 npm ERR! path /home/rob/Development/vue-getting-started/05-interacting-within-a-component/begin/vue-heroes/node_modules/node-sass npm ERR! command failed npm ERR! command sh -c node scripts/build.js npm ERR! Building: /usr/bin/node /home/rob/Development/vue-getting-started/05-interacting-within-a-component/begin/vue-heroes/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library= npm ERR! gyp info it worked if it ends with ok npm ERR! gyp verb cli [ npm ERR! gyp verb cli '/usr/bin/node', npm ERR! gyp verb cli '/home/rob/Development/vue-getting-started/05-interacting-within-a-component/begin/vue-heroes/node_modules/node-gyp/bin/node-gyp.js', npm ERR! gyp verb cli 'rebuild', npm ERR! gyp verb cli '--verbose', npm ERR! gyp verb cli '--libsass_ext=', npm ERR! gyp verb cli '--libsass_cflags=', npm ERR! gyp verb cli '--libsass_ldflags=', npm ERR! gyp verb cli '--libsass_library=' npm ERR! gyp verb cli ] npm ERR! gyp info using node-gyp@3.8.0 npm ERR! gyp info using node@14.15.5 | linux | x64 npm ERR! gyp verb command rebuild [] npm ERR! gyp verb command clean [] npm ERR! gyp verb clean removing "build" directory npm ERR! gyp verb command configure [] npm ERR! gyp verb check python checking for Python executable "/home/rob/anaconda3/bin/python3" in the PATH npm ERR! gyp verb which` succeeded /home/rob/anaconda3/bin/python3 /home/rob/anaconda3/bin/python3
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Command failed: /home/rob/anaconda3/bin/python3 -c import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack File "", line 1
npm ERR! gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack ^
npm ERR! gyp ERR! stack SyntaxError: invalid syntax
npm ERR! gyp ERR! stack
npm ERR! gyp ERR! stack at ChildProcess.exithandler (child_process.js:308:12)
npm ERR! gyp ERR! stack at ChildProcess.emit (events.js:315:20)
npm ERR! gyp ERR! stack at maybeClose (internal/child_process.js:1048:16)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
npm ERR! gyp ERR! System Linux 5.4.0-65-generic
npm ERR! gyp ERR! command "/usr/bin/node" "/home/rob/Development/vue-getting-started/05-interacting-within-a-component/begin/vue-heroes/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd /home/rob/Development/vue-getting-started/05-interacting-within-a-component/begin/vue-heroes/node_modules/node-sass
npm ERR! gyp ERR! node -v v14.15.5
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1

npm ERR! A complete log of this run can be found in:
npm ERR! /home/rob/.npm/_logs/2021-02-16T00_11_04_924Z-debug.log
❯ node-gyp --version
v7.1.2
❯ npm cache verify
Cache verified and compressed (/.npm/_cacache)
Content verified: 1293 (31071323 bytes)
Index entries: 1293
Finished in 3.128s
❯ npm cache clean --force
npm WARN using --force Recommended protections disabled.
❯ npm cache verify
Cache verified and compressed (
/.npm/_cacache)
Content verified: 0 (0 bytes)
Index entries: 0
Finished in 0.013s
❯ npm install
npm ERR! code 1
npm ERR! path /home/rob/Development/vue-getting-started/05-interacting-within-a-component/begin/vue-heroes/node_modules/node-sass
npm ERR! command failed
npm ERR! command sh -c node scripts/build.js
npm ERR! Building: /usr/bin/node /home/rob/Development/vue-getting-started/05-interacting-within-a-component/begin/vue-heroes/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli '/usr/bin/node',
npm ERR! gyp verb cli '/home/rob/Development/vue-getting-started/05-interacting-within-a-component/begin/vue-heroes/node_modules/node-gyp/bin/node-gyp.js',
npm ERR! gyp verb cli 'rebuild',
npm ERR! gyp verb cli '--verbose',
npm ERR! gyp verb cli '--libsass_ext=',
npm ERR! gyp verb cli '--libsass_cflags=',
npm ERR! gyp verb cli '--libsass_ldflags=',
npm ERR! gyp verb cli '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@14.15.5 | linux | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb check python checking for Python executable "/home/rob/anaconda3/bin/python3" in the PATH
npm ERR! gyp verb which succeeded /home/rob/anaconda3/bin/python3 /home/rob/anaconda3/bin/python3
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Command failed: /home/rob/anaconda3/bin/python3 -c import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack File "", line 1
npm ERR! gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack ^
npm ERR! gyp ERR! stack SyntaxError: invalid syntax
npm ERR! gyp ERR! stack
npm ERR! gyp ERR! stack at ChildProcess.exithandler (child_process.js:308:12)
npm ERR! gyp ERR! stack at ChildProcess.emit (events.js:315:20)
npm ERR! gyp ERR! stack at maybeClose (internal/child_process.js:1048:16)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
npm ERR! gyp ERR! System Linux 5.4.0-65-generic
npm ERR! gyp ERR! command "/usr/bin/node" "/home/rob/Development/vue-getting-started/05-interacting-within-a-component/begin/vue-heroes/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd /home/rob/Development/vue-getting-started/05-interacting-within-a-component/begin/vue-heroes/node_modules/node-sass
npm ERR! gyp ERR! node -v v14.15.5
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1

npm ERR! A complete log of this run can be found in:
npm ERR! /home/rob/.npm/_logs/2021-02-16T00_13_56_833Z-debug.log`

On stack exchange they said I needed to install python 2.7 and node-gyp, because they see it in the error message. I assume this is a config file that is accommodating various types of system, as I have never had either of those on this iteration of Linux Mint 20, as it does no longer ship with python 2.7 and I was able to get up to leve4 of the course without those libraries installed before. please help. I've spent 48 hours currently trying to solve this. My only other option is a full os reinstall as I don't know how node works but it likely leaves some kind of hidden .config file that will perpetuate the issue.

Activity

IntelligentFunction

IntelligentFunction commented on Feb 16, 2021

@IntelligentFunction
Author

It appears that this course is very out of date now as many of the dependencies are failing especially when packages are installed by the student. On this occasion, "date-fns" is problematic and breaks the whole site. Another issue is that node-sass is using an out of date package, but it can't be upgraded to node-sass 5.0.0 due to incompatibility issues. Plurasight should be updating these courses as a paid for platform.

For anyone looking for a workaround, to get to the start of module 05, the library encouraged to install "date-fns" is no longer compatible with the sourcecode due to updates. If you did install date-fns and went through the process of fixing the errors prompted by the install process, this then breaks node-sass 4.9.0 which is 2 years out of date. Current version of node-sass is now 5.0.0, but this is not backward compatible with node-sass 4, so node-sass 4.14.1 will get the node server running. I have not yet gone through the tutorial again to see if there are further issues, but npm install was successful but with deprecation errors.

mdanieltg

mdanieltg commented on Apr 8, 2021

@mdanieltg

I am on module 02, presenting the same issue when using npm install and the only thing that worked out was using Yarn instead. I am on Fedora 33 🚀.
Hope this helps.

ColemanTO

ColemanTO commented on Jun 22, 2021

@ColemanTO

There is also an option to run NPM with legacy dependencies: npm install --legacy-peer-deps.

riyajawa

riyajawa commented on Jun 29, 2021

@riyajawa

just install npm install node-sass

rafaspimenta

rafaspimenta commented on Jul 5, 2021

@rafaspimenta

just install npm install node-sass

Thanks! in my case this solution worked very well!

fieldcommandergraeme

fieldcommandergraeme commented on Aug 19, 2021

@fieldcommandergraeme

just install npm install node-sass

Thanks! in my case this solution worked very well!

This doesn't work now, there's a version mismatch between the versions of SASS. Does anyone have an updated fix?

Kasopej

Kasopej commented on Sep 17, 2021

@Kasopej

just install npm install node-sass

Worked for me, though with lots of warnings. At least I can get through the course. Thanks!

davilo61

davilo61 commented on Nov 4, 2021

@davilo61

@Kasopej thanks for the advice above. That worked and allowed me to complete the npm install and serve cmds. Also had a similar issue with another course and I bet that will fix it as well.

shadyyehia

shadyyehia commented on Dec 24, 2021

@shadyyehia

These two commands will do the trick:

  • npm uninstall node-sass

  • npm i -D sass

receptopalak

receptopalak commented on Mar 24, 2022

@receptopalak

If you run yarn install after deleting the node_modules folder, the problem will be solved.

YehiaMahmoud

YehiaMahmoud commented on Jun 9, 2022

@YehiaMahmoud

I think this is working now:

In package.json I replaced
"node-sass": "^4.9.0",
with
"sass": "^1.32.5",

Then npm install

I found this solution in the discussion section by Jason Perry

kafousis

kafousis commented on Aug 4, 2022

@kafousis

I installed node v10.24.1 which is compatible with node-sass 4.9.0 to fix this.
For anyone interested, I use Node Version Manager (nvm) to install and use different versions of node from the terminal which makes it very easy.

xx-final/vue-heroes is running now without problems.

noman0511

noman0511 commented on Nov 14, 2022

@noman0511

I think this is working now:

In package.json I replaced "node-sass": "^4.9.0", with "sass": "^1.32.5",

Then npm install

I found this solution in the discussion section by Jason Perry

It worked for me, I am on NodeJS V16.

vediverg

vediverg commented on May 11, 2023

@vediverg

These two commands will do the trick:

  • npm uninstall node-sass
  • npm i -D sass

wow its amazing, how did you get it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ColemanTO@mdanieltg@kafousis@davilo61@YehiaMahmoud

        Issue actions

          npm install fails every time now · Issue #115 · johnpapa/vue-getting-started