0

A legacy project is using wffranco/vue-strap with Node 8. We are trying to migrate to Node v16.4.2 with NPM 7.18.1, but I can't seem to figure a way to install it:

npm install --save-dev wffranco/vue-strap

I believe it's because of the version of node-sass which is set to be 3.10.1 and node-sass requires to be 6.0 in order to work with Node 16 (according to this table).

So I tried to override the version. I followed this topic: How do I override nested NPM dependency versions?

I created npm-shrinkwrap.json:

{
  "lockfileVersion": 2,
  "requires": true,
  "packages": {},
  "dependencies": {
    "wffranco/vue-strap": {
      "version": "2.0.2",
      "from": "wffranco/vue-strap@2.0.2",
      "dependencies": {
        "node-sass": {
          "version": "6.0.0",
          "from": "node-sass@~3.10.1"
        }
      }
    }
  }
}

But it didn't work. Is it possible to make it work?

The full log if needed:

npm ERR! npm ERR! src/libsass.target.mk:153: recipe for target 'Release/obj.target/libsass/src/libsass/src/ast.o' failed                             
npm ERR! npm ERR! make: Leaving directory '/tmp/.npm/_cacache/tmp/git-clone-3f5c1536/node_modules/node-sass/build'                                                                                                                                                   
npm ERR! npm ERR! gyp info it worked if it ends with ok                                                                                              
npm ERR! npm ERR! gyp verb cli [                                                                                                                     
npm ERR! npm ERR! gyp verb cli   '/usr/nodejs/16.4.2/bin/node',                                                     
npm ERR! npm ERR! gyp verb cli   '/tmp/.npm/_cacache/tmp/git-clone-3f5c1536/node_modules/node-gyp/bin/node-gyp.js',                                                                                                                                                  
npm ERR! npm ERR! gyp verb cli   'rebuild',                                                                                                          
npm ERR! npm ERR! gyp verb cli   '--verbose',                                                                                                        
npm ERR! npm ERR! gyp verb cli   '--libsass_ext=',                                                                                                   
npm ERR! npm ERR! gyp verb cli   '--libsass_cflags=',                                                                                                
npm ERR! npm ERR! gyp verb cli   '--libsass_ldflags=',                                                                                               
npm ERR! npm ERR! gyp verb cli   '--libsass_library='                                                                                                
npm ERR! npm ERR! gyp verb cli ]                                                                                                                     
npm ERR! npm ERR! gyp info using node-gyp@3.8.0                                                                                                      
npm ERR! npm ERR! gyp info using node@16.4.2 | linux | x64                                                                                           
npm ERR! npm ERR! gyp verb command rebuild []                                                                                                        
npm ERR! npm ERR! gyp verb command clean []                                                                                                          
npm ERR! npm ERR! gyp verb clean removing "build" directory                                                                                          
npm ERR! npm ERR! gyp verb command configure []                                                                                                      
npm ERR! npm ERR! gyp verb check python checking for Python executable "python2" in the PATH                                                         
npm ERR! npm ERR! gyp verb `which` succeeded python2 /usr/bin/python2                                                                                
npm ERR! npm ERR! gyp verb check python version `/usr/bin/python2 -c "import sys; print "2.7.18                                                      
npm ERR! npm ERR! gyp verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j                                                       
npm ERR! npm ERR! gyp verb get node dir no --target version specified, falling back to host node version: 16.4.2                                     
npm ERR! npm ERR! gyp verb command install [ '16.4.2' ]                                                                                              
npm ERR! npm ERR! gyp verb install input version string "16.4.2"                                                                                     
npm ERR! npm ERR! gyp verb install installing version: 16.4.2                                                                                        
npm ERR! npm ERR! gyp verb install --ensure was passed, so won't reinstall if already installed                                                      
npm ERR! npm ERR! gyp verb install version is already installed, need to check "installVersion"                                                      
npm ERR! npm ERR! gyp verb got "installVersion" 9                                                                                                    
npm ERR! npm ERR! gyp verb needs "installVersion" 9                                                                                                  
npm ERR! npm ERR! gyp verb install version is good                                                                                                   
npm ERR! npm ERR! gyp verb get node dir target node version installed: 16.4.2                                                                        
npm ERR! npm ERR! gyp verb build dir attempting to create "build" dir: /tmp/.npm/_cacache/tmp/git-clone-3f5c1536/node_modules/node-sass/build                                                                                                                        
npm ERR! npm ERR! gyp verb build dir "build" dir needed to be created? /tmp/.npm/_cacache/tmp/git-clone-3f5c1536/node_modules/node-sass/build                                                                                                                        
npm ERR! npm ERR! gyp verb build/config.gypi creating config file                                                                                    
npm ERR! npm ERR! gyp verb build/config.gypi writing out config file: /tmp/.npm/_cacache/tmp/git-clone-3f5c1536/node_modules/node-sass/build/config.gypi                                                                                                             
npm ERR! npm ERR! (node:10075) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.     
npm ERR! npm ERR! (Use `node --trace-deprecation ...` to show where the warning was created)                                                         
npm ERR! npm ERR! gyp verb config.gypi checking for gypi file: /tmp/.npm/_cacache/tmp/git-clone-3f5c1536/node_modules/node-sass/config.gypi                                                                                                                          
npm ERR! npm ERR! gyp verb common.gypi checking for gypi file: /tmp/.npm/_cacache/tmp/git-clone-3f5c1536/node_modules/node-sass/common.gypi                                                                                                                          
npm ERR! npm ERR! gyp verb gyp gyp format was not specified; forcing "make"                                                                          
npm ERR! npm ERR! gyp info spawn /usr/bin/python2                                                                                                    
npm ERR! npm ERR! gyp info spawn args [                                                                                                              
npm ERR! npm ERR! gyp info spawn args   '/tmp/.npm/_cacache/tmp/git-clone-3f5c1536/node_modules/node-gyp/gyp/gyp_main.py',                                                                                                                                           
npm ERR! npm ERR! gyp info spawn args   'binding.gyp',                                                                                               
npm ERR! npm ERR! gyp info spawn args   '-f',                                                                                                        
npm ERR! npm ERR! gyp info spawn args   'make',                                                                                                      
npm ERR! npm ERR! gyp info spawn args   '-I',                                                                                                        
npm ERR! npm ERR! gyp info spawn args   '/tmp/.npm/_cacache/tmp/git-clone-3f5c1536/node_modules/node-sass/build/config.gypi',                                                                                                                                        
npm ERR! npm ERR! gyp info spawn args   '-I',                                                                                                        
npm ERR! npm ERR! gyp info spawn args   '/tmp/.npm/_cacache/tmp/git-clone-3f5c1536/node_modules/node-gyp/addon.gypi',                                                                                                                                                
npm ERR! npm ERR! gyp info spawn args   '-I',                                                                                                        
npm ERR! npm ERR! gyp info spawn args   '/tmp/.node-gyp/16.4.2/include/node/common.gypi',                                         
npm ERR! npm ERR! gyp info spawn args   '-Dlibrary=shared_library',                                                                                  
npm ERR! npm ERR! gyp info spawn args   '-Dvisibility=default',                                                                                      
npm ERR! npm ERR! gyp info spawn args   '-Dnode_root_dir=/tmp/.node-gyp/16.4.2',                                                  
npm ERR! npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/tmp/.npm/_cacache/tmp/git-clone-3f5c1536/node_modules/node-gyp',                                                                                                                                            
npm ERR! npm ERR! gyp info spawn args   '-Dnode_lib_file=/tmp/.node-gyp/16.4.2/<(target_arch)/node.lib',                          
npm ERR! npm ERR! gyp info spawn args   '-Dmodule_root_dir=/tmp/.npm/_cacache/tmp/git-clone-3f5c1536/node_modules/node-sass',                                                                                                                                        
npm ERR! npm ERR! gyp info spawn args   '-Dnode_engine=v8',                                                                                          
npm ERR! npm ERR! gyp info spawn args   '--depth=.',                                                                                                 
npm ERR! npm ERR! gyp info spawn args   '--no-parallel',                                                                                             
npm ERR! npm ERR! gyp info spawn args   '--generator-output',                                                                                        
npm ERR! npm ERR! gyp info spawn args   'build',                                                                                                     
npm ERR! npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! npm ERR! gyp info spawn args ]
npm ERR! npm ERR! gyp verb command build []
npm ERR! npm ERR! gyp verb build type Release
npm ERR! npm ERR! gyp verb architecture x64
npm ERR! npm ERR! gyp verb node dev dir /tmp/.node-gyp/16.4.2
npm ERR! npm ERR! gyp verb `which` succeeded for `make` /usr/bin/make
npm ERR! npm ERR! gyp info spawn make
npm ERR! npm ERR! gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! npm ERR! g++: error: unrecognized command line option '-std=gnu++14'
npm ERR! npm ERR! make: *** [Release/obj.target/libsass/src/libsass/src/ast.o] Error 1
npm ERR! npm ERR! gyp ERR! build error
npm ERR! npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! npm ERR! gyp ERR! stack     at ChildProcess.onExit (/tmp/.npm/_cacache/tmp/git-clone-3f5c1536/node_modules/node-gyp/lib/build.js:262:23)
npm ERR! npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:394:28)
npm ERR! npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! npm ERR! gyp ERR! System Linux 4.12.14-122.60-default
npm ERR! npm ERR! gyp ERR! command "/usr/nodejs/16.4.2/bin/node" "/tmp/.npm/_cacache/tmp/git-clone-3f5c1536/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! npm ERR! gyp ERR! cwd /tmp/.npm/_cacache/tmp/git-clone-3f5c1536/node_modules/node-sass
npm ERR! npm ERR! gyp ERR! node -v v16.4.2
npm ERR! npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! npm ERR! gyp ERR! not ok
npm ERR! npm ERR! Build failed with error code: 1
npm ERR!
npm ERR! npm ERR! A complete log of this run can be found in:
npm ERR! npm ERR!     /tmp/.npm/_logs/2022-12-19T14_25_19_038Z-debug.log

npm ERR! A complete log of this run can be found in:
npm ERR!     /tmp/.npm/_logs/2022-12-19T14_25_19_181Z-debug.log
kissu
  • 40,416
  • 14
  • 65
  • 133
vesii
  • 2,760
  • 4
  • 25
  • 71
  • The problem is misidentified, node-sass is dev dep in vue-strap, means that it doesn't affect the project that uses it – Estus Flask Dec 19 '22 at 15:34
  • @EstusFlask I see. For debugging I'm using an empty `package.json` and only trying to install `wffranco/vue-strap`. It works with Node 8 but not with Node 15/16. What could be the reason then? – vesii Dec 19 '22 at 15:39
  • What npm did you use with 8? It looks like it works with npm 6, but not 7 and 8. not sure why this happens for them, possibly they handle git deps in a special and unpredictable way. In my experience they are broken in multiple ways, I'd suggest to switch to Yarn 1 to keep things more stable, you'd have more control over nested deps there too – Estus Flask Dec 19 '22 at 16:21
  • @EstusFlask I used NPM 5.6.0 – vesii Dec 21 '22 at 09:49
  • Then that's it. I'd suggest to switch to Yarn 1.x for this project as it's more predictable – Estus Flask Dec 21 '22 at 10:25

0 Answers0