1

我跑了一个,但在ornpm install上崩溃了。终端错误(全文):contextifynode-gyp

    yug@.../make-modules-d$ npm install
    > contextify@0.1.15 install /media/yug/b7afba40-86bd-4df2-b20d-fdf572995ff2/projects_maps/make-modules-d/node_modules/contextify
    > node-gyp rebuild
    
    make: Entering directory '/media/yug/b7afba40-86bd-4df2-b20d-fdf572995ff2/projects_maps/make-modules-d/node_modules/contextify/build'
      CXX(target) 
    
    Release/obj.target/contextify/src/contextify.o

    ... # lot of logs here~~~~~~~~~

    make: *** [contextify.target.mk:111: Release/obj.target/contextify/src/contextify.o] Error 1
    make: Leaving directory '/media/yug/b7afba40-86bd-4df2-b20d-fdf572995ff2/projects_maps/make-modules-d/node_modules/contextify/build'
    gyp ERR! build error 
    gyp ERR! stack Error: `make` failed with exit code: 2
    gyp ERR! stack     at ChildProcess.onExit (/home/yug/.nvm/versions/node/v14.4.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
    gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
    gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
    gyp ERR! System Linux 5.4.0-42-lowlatency
    gyp ERR! command "/home/yug/.nvm/versions/node/v14.4.0/bin/node" "/home/yug/.nvm/versions/node/v14.4.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
    gyp ERR! cwd /media/yug/b7afba40-86bd-4df2-b20d-fdf572995ff2/projects_maps/make-modules-d/node_modules/contextify
    gyp ERR! node -v v14.4.0
    gyp ERR! node-gyp -v v5.1.0
    gyp ERR! not ok 
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! contextify@0.1.15 install: `node-gyp rebuild`

/home/yug/.npm/_logs/2020-09-01T08_53_57_780Z-debug.log得到了:

    182 verbose stack Error: contextify@0.1.15 install: `node-gyp rebuild`
    182 verbose stack Exit status 1
    182 verbose stack     at EventEmitter.<anonymous> (/home/yug/.nvm/versions/node/v14.4.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
    182 verbose stack     at EventEmitter.emit (events.js:315:20)
    182 verbose stack     at ChildProcess.<anonymous> (/home/yug/.nvm/versions/node/v14.4.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
    182 verbose stack     at ChildProcess.emit (events.js:315:20)
    182 verbose stack     at maybeClose (internal/child_process.js:1051:16)
    182 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
    183 verbose pkgid contextify@0.1.15
    184 verbose cwd /media/yug/b7afba40-86bd-4df2-b20d-fdf572995ff2/projects_maps/make-modules-d
    185 verbose Linux 5.4.0-42-lowlatency
    186 verbose argv "/home/yug/.nvm/versions/node/v14.4.0/bin/node" "/home/yug/.nvm/versions/node/v14.4.0/bin/npm" "install"
    187 verbose node v14.4.0
    188 verbose npm  v6.14.7
    189 error code ELIFECYCLE
    190 error errno 1
    191 error contextify@0.1.15 install: `node-gyp rebuild`
    191 error Exit status 1
    192 error Failed at the contextify@0.1.15 install script.
    192 error This is probably not a problem with npm. There is likely additional logging output above.
    193 verbose exit [ 1, true ]

[编辑:]

系统:Ubuntu 20.04

$Python --版本:Python 2.7.18rc1

$节点--版本:v14.4.0

$npm --版本:6.14.7

$node-gyp --version :

    internal/modules/cjs/loader.js:1032
      throw err;
      ^
    
    Error: Cannot find module 'nopt'
    Require stack:
    - /usr/share/nodejs/node-gyp/lib/node-gyp.js
    - /usr/share/nodejs/node-gyp/bin/node-gyp.js
        at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1029:15)
        at Function.Module._load (internal/modules/cjs/loader.js:898:27)
        at Module.require (internal/modules/cjs/loader.js:1089:19)
        at require (internal/modules/cjs/helpers.js:73:18)
        at Object.<anonymous> (/usr/share/nodejs/node-gyp/lib/node-gyp.js:4:14)
        at Module._compile (internal/modules/cjs/loader.js:1200:30)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
        at Module.load (internal/modules/cjs/loader.js:1049:32)
        at Function.Module._load (internal/modules/cjs/loader.js:937:14)
        at Module.require (internal/modules/cjs/loader.js:1089:19) {
      code: 'MODULE_NOT_FOUND',
      requireStack: [
        '/usr/share/nodejs/node-gyp/lib/node-gyp.js',
        '/usr/share/nodejs/node-gyp/bin/node-gyp.js'
      ]
    }

似乎 node-gyp > nopt 出了点问题...(我继续挖掘)

我真的很困惑。当我阅读这些错误时,我觉得 node-gyp 依赖于 nopt,而 nopt 又依赖于 nodegyp。

4

0 回答 0