繁体   English   中英

使用 Node 16 和 NPM 7 安装 vue-strap

[英]Installing vue-strap with Node 16 and NPM 7

遗留项目正在使用wffranco/vue-strap和 Node 8。我们正在尝试使用 NPM 7.18.1 迁移到 Node v16.4.2,但我似乎无法找到安装它的方法:

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

我相信这是因为node-sass的版本设置为3.10.1 ,而 node-sass 需要6.0才能与 Node 16 一起使用(根据此)。

所以我试图覆盖版本。 我关注了这个主题: How do I override nested NPM dependency versions?

我创建了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"
        }
      }
    }
  }
}

但它没有用。 有可能让它发挥作用吗?

完整日志(如果需要):

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

在同一个包wffranco/vue-strap中遇到了类似的问题。 我在 github 上分叉了它,并从依赖项中删除了 node-sass。 这对我有帮助。 试试我的包,它也可能对你有帮助edheldor/vue-strap

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM